<
telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource">
<MasterTableView AutoGenerateColumns="false">
<Columns>
<telerik:GridBoundColumn DataField="ID" visible="true"></telerik:GridBoundColumn>
<telerik:GridDropDownColumn HeaderText="Document type" UniqueName="DocType" DataField="DocVal"
ListTextField="SubmitForm" ListValueField="DocVal" DropDownControlType="DropDownList"
EnableEmptyListItem="true" EmptyListItemText="---Choose an option--">
</telerik:GridDropDownColumn>
<telerik:GridTemplateColumn HeaderText="File to upload" UniqueName="TemplateColumn1">
<ItemTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Will Fax Later" UniqueName="TemplateColumn2">
<ItemTemplate>
<asp:CheckBox ID="FaxLater" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Status" UniqueName="TemplateColumn3">
<ItemTemplate>
<asp:Label ID="Status" runat="server" Text=" "></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
ds = GetSecondaryData()
Dim i As Integer
For i = 0 To FileCount - 1
arr.Add(FileCount)
Next
'Dim ddl As DropDownList
'ddl = RadGrid1.Items("TemplateColumn").FindControl("DDL1")
'ddl.DataSource = ds
'ddl.DataBind()
Dim table As DataTable = New DataTable()
table.Columns.Add(
"ID")
table.Columns.Add(
"SubmitForm")
table.Columns.Add(
"DocVal")
For i = 0 To arr.Count - 1
Dim row As DataRow = table.NewRow()
row(
"ID") = i
row(
"SubmitForm") = ds.Tables(0).Rows(i).Item(1)
row(
"DocVal") = ds.Tables(0).Rows(i).Item(0)
table.Rows.Add(row)
Next
RadGrid1.DataSource = table
RadGrid1.DataBind()
RadGrid1.Visible =
True
ds is a dataset populated with two columns, DocVal and SubmitForm.
arr is an Array.
I'm in kind of a bind here. I've been beating my head on the wall with this all day. Any help would be greatly appreciated.
| Sir I have a Page, say Page1.aspx.In it a radGrid and link button is placed When I click on the linkbutton, a radwindow with a usercontrol is loaded. ie, in Page1.aspx function OpenRadWindowCustomSearch() { var oWnd = radopen("Custom_Search_Page.aspx", "RadWindow2" ); oWnd.setSize(700,550) oWnd.center(); } Inside Custom_Search_Page.aspx ,I placed a usercontrol ie,in Custom_Search_Page.aspx < form id="form1" runat="server"> <div> <uc1:CustomSearch id="uclCustomSearch" runat="server" /> </div> </form> That usercontrol contains a buttonWhile clicking on tht button I want to rabind the grid in Page1 |
|
|
|
I tried with
top.$get("btnRebindGrid").click(); |
|
I m gettg the javascript error
Page1.aspxPage1.aspx.vb'top.$get(..)is null or not an object when i write it in code behind of usercontrol ie, Usercontrol.ascx.vb Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click Dim ds As New DataSet() ds = Custom_SearchBAL.GridDataSource Dim strFilterExp As String Dim i As Integer For i = 0 To ds.Tables(0).Rows.Count - 1 Custom_SearchBAL.SelectedFieldDatatype = ds.Tables(0).Rows(i)( "Datatype") strFilterExp = strFilterExp + ds.Tables(0).Rows(i)( "ANDOR") + ds.Tables(0).Rows(i)("FilterExp") Next Custom_SearchBAL.ResultantFilterExp = strFilterExp Dim strScript As String strScript = "<script language=javascript>" strScript += "top.$get('btnRebindGrid').click();" strScript += "<" strScript += "/script>" Page.RegisterStartupScript( "MSGE", strScript) Page1.aspx<asp:Button ID="btnRebindGrid" runat="server" Text="RebindGrid" style="display:none" /> Page1.aspx.vbProtected Sub btnRebindGrid_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRebindGrid.Click WorkDetailsGrid.Rebind() End Sub |
| Sub loaddpts() | |
| Dim dt As New Data.DataTable | |
| functions.FillDT(dt, ConnStrings.ConnectionStrings, "Select Distinct Department from leaders_employees where user_empid = '" & Session("EMPID") & "'") | |
| CCDropDown.DataTextField = "Department" | |
| CCDropDown.DataValueField = "Department" | |
| CCDropDown.DataSource = dt | |
| CCDropDown.DataBind() | |
| End Sub | |
| Sub fillJDCS(ByVal x As String) | |
| Dim dptds As New Data.DataTable | |
| Dim SQL As String = "Select Distinct sp_job_code,job_title from leaders_employees where department = '" & x & "' and user_empid = '" & Session("EMPID") & "'" | |
| functions.FillDT(dptds, ConnStrings.ConnectionStrings, SQL) | |
| JDCDD.DataSource = dptds | |
| ' JDCDD.DataValueField = "sp_job_code" | |
| JDCDD.DataTextField = "Job_title" | |
| JDCDD.DataBind() | |
| End Sub | |
| Protected Sub CCDropDown_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CCDropDown.Load | |
| If Not IsPostBack Then | |
| loaddpts() | |
| End If | |
| End Sub | |
| Protected Sub CCDropDown_SelectedIndexChanged1(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles CCDropDown.SelectedIndexChanged | |
| fillJDCS(CCDropDown.SelectedValue) | |
| End Sub | |
| Protected Sub JDCDD_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles JDCDD.Load | |
| If Not IsPostBack Then | |
| fillJDCS(CCDropDown.SelectedValue) | |
| End If | |
| End Sub | |
| Protected Sub DD1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD1.Load | |
| If Not IsPostBack Then | |
| Dim dt As New Data.DataTable | |
| functions.FillDT(dt, ConnStrings.ConnectionStrings, "Select Distinct Department from leaders_employees where user_empid = '" & Session("EMPID") & "'") | |
| DD1.DataSource = dt | |
| DD1.DataTextField = "department" | |
| DD1.DataValueField = "department" | |
| DD1.DataBind() | |
| End If | |
| End Sub | |
| Protected Sub DD2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD2.Load | |
| If Not IsPostBack Then | |
| filldd2(DD1.SelectedValue) | |
| End If | |
| End Sub | |
| Protected Sub DD1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DD1.SelectedIndexChanged | |
| filldd2(DD1.SelectedValue) | |
| End Sub | |
| Sub filldd2(ByVal x As String) | |
| Dim dt As New Data.DataTable | |
| functions.FillDT(dt, ConnStrings.ConnectionStrings, "Select Distinct sp_job_code,job_title from leaders_employees where department = '" & x & "' and user_empid = '" & Session("EMPID") & "'") | |
| DD2.DataSource = dt | |
| DD2.DataTextField = "job_title" | |
| DD2.DataValueField = "sp_job_code" | |
| DD2.DataBind() | |
| End Sub |