Similar Threads:
1.DataGrid with DropDownLists not responding to OnSelectedIndexChanged
Hello group,
I have a TemplateColumn containing a DropDownList in my DataGrid. I added
an OnSelectedIndexChanged property in that DropDownList, but I can see in
debug mode that changing the selection will not call my function defined in
OnSelectedIndexChanged (the page reloads, I didn't forget
AutoPostBack=true).
Is this normal ? Is there a way around it ?
Karine
2.How raise an OnSelectedIndexChanged for an DropDownList in footer of a DataGrid?
Hi!
In a DataGrid I have a 'Add New'-field in the footer. I
want to hide an control (txtNewFe_name) if the value of
cmbNewFe_num is >0. How do I do that? The
OnSelectedIndexChanged does not seem to response to
anything, even though I tryed with just:
Function CheckFe_num()
Response.Write("Hello World!")
End Function
Best regards / Bengt-Erik
MyPage.aspx
........
........
<FooterTemplate>
<asp:DropDownList id="cmbNewFe_num" DataSource="<%#
PopulateNewFe_num() %>" DataValueField="Id"
DataTextField="Fe_num" runat="server"
OnSelectedIndexChanged="<%# CheckFe_num() %>"/>
</FooterTemplate>
........
........
........
<FooterTemplate>
<asp:TextBox id="txtNewFe_name" runat="server"
TextMode="MultiLine" />
</FooterTemplate>
.......
.......
MyPage.aspx.vb
.....
.....
Function CheckFe_num()
If CType(FindControl("cmbFe_num"),
DropDownList).SelectedItem.Value > 0 Then
CType(FindControl("txtNewFe_name"), TextBox).Text
= ""
CType(FindControl("txtNewFe_name"),
TextBox).Visible = False
Else
CType(FindControl("txtNewFe_name"),
TextBox).Visible = True
End If
End Function
......
......
3.How do I raise an OnSelectedIndexChanged for an DropDownList in the footer of a DataGrid?
Hi!
In a DataGrid I have a 'Add New'-field in the footer. I want to hide an
control (txtNewFe_name) if the value of cmbNewFe_num is >0. How do I do
that? The OnSelectedIndexChanged does not seem to response to anything, even
though I tryed with just:
Function CheckFe_num()
Response.Write("Hello World!")
End Function
Best regards / Bengt-Erik
MyPage.aspx
.......
.......
<FooterTemplate>
<asp:DropDownList id="cmbNewFe_num" DataSource="<%# PopulateNewFe_num()
%>" DataValueField="Id" DataTextField="Fe_num" runat="server"
OnSelectedIndexChanged="<%# CheckFe_num() %>"/>
</FooterTemplate>
.......
.......
.......
<FooterTemplate>
<asp:TextBox id="txtNewFe_name" runat="server" TextMode="MultiLine" />
</FooterTemplate>
......
......
MyPage.aspx.vb
....
....
Function CheckFe_num()
If CType(FindControl("cmbFe_num"), DropDownList).SelectedItem.Value > 0
Then
CType(FindControl("txtNewFe_name"), TextBox).Text = ""
CType(FindControl("txtNewFe_name"), TextBox).Visible = False
Else
CType(FindControl("txtNewFe_name"), TextBox).Visible = True
End If
End Function
.....
.....
4.How raise an OnSelectedIndexChanged for an DropDownList in footer of a DataGrid?
Hi!
In a DataGrid I have a 'Add New'-field in the footer. I
want to hide an control (txtNewFe_name) if the value of
cmbNewFe_num is >0. How do I do that? The
OnSelectedIndexChanged does not seem to response to
anything, even though I tryed with just:
Function CheckFe_num()
Response.Write("Hello World!")
End Function
Best regards / Bengt-Erik
MyPage.aspx
.......
.......
<FooterTemplate>
<asp:DropDownList id="cmbNewFe_num" DataSource="<%#
PopulateNewFe_num() %>" DataValueField="Id"
DataTextField="Fe_num" runat="server"
OnSelectedIndexChanged="<%# CheckFe_num() %>"/>
</FooterTemplate>
.......
.......
.......
<FooterTemplate>
<asp:TextBox id="txtNewFe_name" runat="server"
TextMode="MultiLine" />
</FooterTemplate>
......
......
MyPage.aspx.vb
....
....
Function CheckFe_num()
If CType(FindControl("cmbFe_num"),
DropDownList).SelectedItem.Value > 0 Then
CType(FindControl("txtNewFe_name"), TextBox).Text
= ""
CType(FindControl("txtNewFe_name"),
TextBox).Visible = False
Else
CType(FindControl("txtNewFe_name"),
TextBox).Visible = True
End If
End Function
.....
.....
5.Can't databind a dropdownlist in the footer of a datagrid
Hi there, I'm trying to databind a dropdownlist that is in the footer row of a datagrid and I can't get it to work. Here's a chunk of the code:
FP.Intranet.Portal.transloadDB lorries = new FP.Intranet.Portal.transloadDB();
//this next line definitely works as I have used the dsLorries.GetXML to debug and
//the dataset is definitely populated.
DataSet dsLorries = lorries.GetLorries("BB");
lstLorries.DataSource = dsLorries;
lstLorries.DataTextField = "rl_load_name";
lstLorries.DataBind();
I've put it in the datagrid's itemDatabound event and it just shows up empty.
Please Help!
--
Tim McOwan
6. dropdownlist in footer of datagrid
7. Datagrid footer bound dropdownlist
8. Can't add item to dropdownlist in datagrid footer