1.
<asp:TemplateField HeaderText="">
<EditItemTemplate>
<asp:RadioButtonList ID="rdVorI" runat="server" RepeatDirection="Horizontal" AutoPostBack="true"
OnSelectedIndexChanged="rdVorI_SelectedIndexChanged">
<asp:ListItem Value="Video" Text="Video" Selected="True"></asp:ListItem>
<asp:ListItem Value="Image" Text="Image"></asp:ListItem>
</asp:RadioButtonList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Video">
<ItemTemplate>
<asp:ImageButton ID="vdoBtn" Height="60px" Width="60px" AlternateText="Video" BorderWidth="1px"
BorderColor="Black" runat="server" title="Click Here" />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtEvCode" runat="server" Width="160px" />
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Images">
<ItemTemplate>
<asp:HiddenField ID="key" runat="server" Value='<%#Eval("EventID") %>' />
<asp:ImageButton ID="imgBtn" class="thumbnail" AlternateText="Image" BorderWidth="1px"
BorderColor="Black" runat="server" />
<asp:ImageButton ID="imgBtn2" class="thumbnail" AlternateText="Image" BorderWidth="1px"
BorderColor="Black" runat="server" />
<asp:ImageButton ID="imgBtn3" class="thumbnail" AlternateText="Image" BorderWidth="1px"
BorderColor="Black" runat="server" />
</ItemTemplate>
<EditItemTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" /><br />
<asp:FileUpload ID="FileUpload2" runat="server" /><br />
<asp:FileUpload ID="FileUpload3" runat="server" />
</EditItemTemplate>
</asp:TemplateField>
2.
protected void rdVorI_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow gr = (GridViewRow)((DataControlFieldCell)((RadioButtonList)sender).Parent).Parent;
RadioButtonList rdl = (RadioButtonList)gr.FindControl("rdVorI");
FileUpload vFile1 = (FileUpload)gr.FindControl("FileUpload1");
FileUpload vFile2 = (FileUpload)gr.FindControl("FileUpload2");
FileUpload vFile3 = (FileUpload)gr.FindControl("FileUpload3");
TextBox vTitle = (TextBox)gr.FindControl("txtEvCode");
if (rdl.SelectedValue == "Video")
{
vFile1.Enabled = false;
vFile2.Enabled = false;
vFile3.Enabled = false;
vTitle.Enabled = true;
}
else
{
vTitle.Enabled = false;
vFile1.Enabled = true;
vFile2.Enabled = true;
vFile3.Enabled = true;
}
}
Cheers!!!