<EditFormSettings EditColumn-UpdateText="Update" EditColumn-ButtonType="ImageButton" PopUpSettings-Modal="true" InsertCaption="Add new item" CaptionFormatString="ITAdmin: {0} " CaptionDataField="EmployeeName" EditFormType="Template">
<FormTemplate>
<table id="tblUs" cellspacing="1" cellpadding="1" width="250" border="0">
<tr><td></td><td></td></tr><tr><td></td><td>
<table width="245px" id="TBLUSERS" border="0" cellspacing="0" cellpadding="0">
<tr><td>
<asp:TextBox ID="GridtxtSearch" runat="server" Width="175px"></asp:TextBox>
<asp:Button ID="GrdbtnGo" runat="server" OnClick="Populate" Text="Go" />
<asp:Label Visible="false" runat="server" ID="hdnId" Text='<%#Eval("id") %>' />
<asp:Label Visible="false" runat="server" ID="hdnSiteName" Text='<%#Eval("Name") %>' />
<asp:Label Visible="false" runat="server" ID="hdnITAdminName" Text='<%#Eval("EmployeeName") %>' />
<asp:Label Visible="false" runat="server" ID="hdnITAdminId" Text='<%#Eval("ITAdminId") %>' />
</td> <td>
</td>
</tr>
<tr>
<td>
Entity : <asp:DropDownList ID="drpSiteCode_" AppendDataBoundItems="true" runat="server" AutoPostBack="false">
<asp:ListItem Value="-">Select --</asp:ListItem>
</asp:DropDownList>
<span style="color: Red">
<asp:RequiredFieldValidator ID="rfvSite" runat="server" ControlToValidate="drpSiteCode_"
ErrorMessage="Please select an Entity" ValidationGroup="rfGrdSiteCode" InitialValue="-" Font-Size="Smaller"></asp:RequiredFieldValidator>
</span>
</td>
<td>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<asp:ListBox Width="233px" ID="GrdlstallNetIds" runat="server" SelectionMode="Single"
Height="270px"></asp:ListBox>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lbNoRecordsExistMyRequestsf" runat="server" Font-Size="Smaller"></asp:Label>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table style="width: 100%">
<tr>
<td align="right" colspan="2">
<asp:Button ValidationGroup="rfGrdSiteCode" ID="Button2" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'
runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'>
</asp:Button>
<asp:Button ID="Button3" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
</asp:Button>
</td>
</tr>
</table>
</FormTemplate>
<FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle>
<FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>
<FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
<EditColumn ButtonType="ImageButton" />
<PopUpSettings Modal="true" />
</EditFormSettings>
When btnGo is Clicked ,
I want to get the GridtxtSearch value to repopulate the GrdlstallNetIds everytime.But always when the First row in the Grid is selected , I can able to get the GridtxtSearch value , Can u help me to check how to get the selected griditem
GridtxtSearch value?
Protected Sub Populate()
Dim grditem As GridItem
grditem = rdGridSite.MasterTableView.GetItems(
GridItemType.EditFormItem)(0)
Dim txtSearch As TextBox = CType(grditem.FindControl("GridtxtSearch"), TextBox)
Dim hdnId As Label = CType(grditem.FindControl("hdnId"), Label)
Dim GrdlstallNetIds As ListBox = CType(grditem.FindControl("GrdlstallNetIds"), ListBox)
Try
Dim empDao1 As New EmployeeDAL()
Dim ds1 As New DataSet()
If txtSearch.Text = String.Empty Then
ds1 = empDao1.GetAllNetworkids()
Else
ds1 = empDao1.GetAllNetworkids(txtSearch.Text)
End If
Dim dt As New DataTable()
dt = ds1.Tables(0)
GrdlstallNetIds.DataSource = dt
GrdlstallNetIds.DataTextField = "DisplayName"
GrdlstallNetIds.DataValueField = "SamaccountName"
GrdlstallNetIds.DataBind()
Catch ex As Exception
Exit Sub
End Try
End Sub
Thanks