S
sergeyr3
Hey guys,
I am new here, so i hope this works out:
I have a datagrid which I populate with data from XML file. In
EditItemTemplate I have a dropdownlist. How do I fire
myDataGrid_UpdateCommand upon SelectedIndexChanged event in the
dropdownlist? thank you.
-Sergey
<ASPataGrid id="myDataGrid" runat="server"
AutoGenerateColumns="False" HeaderStyle-BackColor="#aaaadd"
Font-Size="8pt" ShowFooter="True" BorderColor="Black"
BackColor="WhiteSmoke" AllowSorting="true">
<HeaderStyle BackColor="LightGray"></HeaderStyle>
<FooterStyle BackColor="LightGray"></FooterStyle>
<Columns>
<ASP:TemplateColumn HeaderText="Date"
SortExpression="announcement_date">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem,
"announcement_date")%>
</ItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="Subject"
SortExpression="Subject">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "subject")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="subjectTxt" style="size:15" Text=' <%#
DataBinder.Eval(Container.DataItem, "subject") %> ' runat="server"
Width="100" />
</EditItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="First Name"
SortExpression="first_name">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "first_name")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="firstTxt" style="size:15" Text=' <%#
DataBinder.Eval(Container.DataItem, "first_name") %> ' runat="server"
Width="100" />
</EditItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="Message"
SortExpression="description">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "description")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="descTxt" runat="server" Height="100px"
TextMode="MultiLine" Width="333px" Text='<%#
DataBinder.Eval(Container.DataItem, "description") %> '/>
</EditItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="Status"
SortExpression="approved">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "approved")%>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList ID="lstSubject" runat="server"
Width="110px" AutoPostBack="True">
<asp:ListItem
Value="Pending">Pending</asp:ListItem>
<asp:ListItem
Value="Approved">Approve</asp:ListItem>
<asp:ListItem Value="Delete">Delete/Enter a
Reason</asp:ListItem>
</aspropDownList>
</EditItemTemplate>
</ASP:TemplateColumn>
<asp:EditCommandColumn CancelText="Cancel" EditText="Edit"
HeaderText="Edit" UpdateText="Update">
</asp:EditCommandColumn>
<asp:ButtonColumn CommandName="Delete" HeaderText="Delete"
Text="Delete"></asp:ButtonColumn>
</Columns>
I am new here, so i hope this works out:
I have a datagrid which I populate with data from XML file. In
EditItemTemplate I have a dropdownlist. How do I fire
myDataGrid_UpdateCommand upon SelectedIndexChanged event in the
dropdownlist? thank you.
-Sergey
<ASPataGrid id="myDataGrid" runat="server"
AutoGenerateColumns="False" HeaderStyle-BackColor="#aaaadd"
Font-Size="8pt" ShowFooter="True" BorderColor="Black"
BackColor="WhiteSmoke" AllowSorting="true">
<HeaderStyle BackColor="LightGray"></HeaderStyle>
<FooterStyle BackColor="LightGray"></FooterStyle>
<Columns>
<ASP:TemplateColumn HeaderText="Date"
SortExpression="announcement_date">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem,
"announcement_date")%>
</ItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="Subject"
SortExpression="Subject">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "subject")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="subjectTxt" style="size:15" Text=' <%#
DataBinder.Eval(Container.DataItem, "subject") %> ' runat="server"
Width="100" />
</EditItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="First Name"
SortExpression="first_name">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "first_name")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="firstTxt" style="size:15" Text=' <%#
DataBinder.Eval(Container.DataItem, "first_name") %> ' runat="server"
Width="100" />
</EditItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="Message"
SortExpression="description">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "description")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="descTxt" runat="server" Height="100px"
TextMode="MultiLine" Width="333px" Text='<%#
DataBinder.Eval(Container.DataItem, "description") %> '/>
</EditItemTemplate>
</ASP:TemplateColumn>
<ASP:TemplateColumn HeaderText="Status"
SortExpression="approved">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "approved")%>
</ItemTemplate>
<EditItemTemplate>
<aspropDownList ID="lstSubject" runat="server"
Width="110px" AutoPostBack="True">
<asp:ListItem
Value="Pending">Pending</asp:ListItem>
<asp:ListItem
Value="Approved">Approve</asp:ListItem>
<asp:ListItem Value="Delete">Delete/Enter a
Reason</asp:ListItem>
</aspropDownList>
</EditItemTemplate>
</ASP:TemplateColumn>
<asp:EditCommandColumn CancelText="Cancel" EditText="Edit"
HeaderText="Edit" UpdateText="Update">
</asp:EditCommandColumn>
<asp:ButtonColumn CommandName="Delete" HeaderText="Delete"
Text="Delete"></asp:ButtonColumn>
</Columns>