


| RadGridAudioFileReport = New RadGrid |
| Dim boundColumnClientID, boundColumnClient, boundColumnTotal As New GridBoundColumn |
| Dim templatecolumnActive, templatecolumnSupport, templatecolumnFinal As New GridTemplateColumn |
| RadGridAudioFileReport.DataSource = Nothing |
| RadGridAudioFileReport.DataSource = Fill_Allocation_Report_Grid() |
| RadGridAudioFileReport.Width = Unit.Pixel(2600) |
| RadGridAudioFileReport.Skin = "Office2007" |
| RadGridAudioFileReport.AutoGenerateColumns = False |
| RadGridAudioFileReport.MasterTableView.DataKeyNames = New String() {"Client_ID"} |
| boundColumnClientID.HeaderText = "Client_ID" |
| boundColumnClientID.DataField = "Client_ID" |
| boundColumnClientID.UniqueName = "Client_ID" |
| boundColumnClientID.Visible = False |
| RadGridAudioFileReport.MasterTableView.Columns.Add(boundColumnClientID) |
| boundColumnClient.HeaderText = "Client" |
| boundColumnClient.DataField = "Client" |
| boundColumnClient.UniqueName = "Client" |
| RadGridAudioFileReport.MasterTableView.Columns.Add(boundColumnClient) |
| boundColumnTotal.HeaderText = "Total" |
| boundColumnTotal.DataField = "Total" |
| boundColumnTotal.UniqueName = "Total" |
| templatecolumnActive.HeaderTemplate = New MyTemplateActiveHeader() |
| templatecolumnActive.ItemTemplate = New MyTemplateActiveItems() |
| RadGridAudioFileReport.MasterTableView.Columns.Add(templatecolumnActive) |
| Dim tableViewAccounts As New GridTableView(RadGridAudioFileReport) |
| Dim boundColumnAccountID, boundColumnAccount As New GridBoundColumn |
| tableViewAccounts.DataSource = Accounts_FileAllocation_Report_Data() |
| tableViewAccounts.Width = Unit.Percentage(100) |
| tableViewAccounts.AutoGenerateColumns = False |
| tableViewAccounts.DataKeyNames = New String() {"accountid"} |
| Dim relationFields As GridRelationFields = New GridRelationFields() |
| tableViewAccounts.ParentTableRelation.Add(relationFields) |
| RadGridAudioFileReport.MasterTableView.DetailTables.Add(tableViewAccounts) |
| boundColumnAccountID.DataField = "accountid" |
| boundColumnAccountID.HeaderText = "accountid" |
| boundColumnAccountID.UniqueName = "accountid" |
| 'boundColumnAccountID.Visible = False |
| tableViewAccounts.Columns.Add(boundColumnAccountID) |
| boundColumnAccount.DataField = "account" |
| boundColumnAccount.HeaderText = "Account" |
| boundColumnAccount.UniqueName = "Account" |
| tableViewAccounts.Columns.Add(boundColumnAccount) |
| RadGridAudioFileReport.DataBind() |
| Me.PlaceHolder1.Controls.Add(RadGridAudioFileReport) |
| Public Function Accounts_FileAllocation_Report_Data(ByVal client_id As String) |
| MsgBox(client_id.ToString()) |
| cmd = New MySqlCommand("SELECT id as accountid,accname as account FROM account_master where ccode='" & client_id & "' and delflag=0;", con) |
| myda = New MySqlDataAdapter(cmd) |
| AccountsActiveDT = New DataTable |
| myda.Fill(AccountsActiveDT) |
| Return AccountsActiveDT |
| End Function |
I have problems with the RadComBox Load-On-Demand combined with data binding.
Below is the code,
aspx
(I am using declaretive datasource (dataset) ), Below aspx is putting under FormView,
<telerik:RadComboBox Skin="Hay" ID="RadComboVendorID" runat="server"
DataSourceID="DBDataSource1" DataMember="PurchaseHeader.VendorInformation_Via_VendorID" DataTextField="VendorID" DataValueField="VendorID" SelectedValue ='<%# Bind("VendorID") %>' DropDownWidth ="550" Height ="270" Width ="105"
HighlightTemplatedItems = "true" Sort="Ascending" MarkFirstMatch="True" AutoPostBack = "true" OnItemsRequested= 'RadComboBox_ItemsRequested' EnableLoadOnDemand ="true" ShowMoreResultsBox ="true" EnableVirtualScrolling ="true" />
and, Code Behind,ItemsRequested function, I filter out the data source that binded to the page base on whatever condition, see below,
Public Sub RadComboBox_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs)
Dim combo As RadComboBox = TryCast(sender, RadComboBox)
datasource.FilterTable("VendorInformation", "VendorID LIKE '%abcedfg%'")
combo.DataSource = ds
combo.databind()
End Sub
But, it give error on combo.databind() line, say binding function must bind in the context of .................
i take away combo.databind() line, the datasource only get filtered after fresh not through AJAX posting.
Any solution for that ? Thanks .
| <telerik:GridTemplateColumn UniqueName="StatusColumn" HeaderText="Approved Status"> |
| <ItemTemplate> |
| <asp:Label id="lblStatus" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "status") %>'> |
| </asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:DropDownList id="ddlApprovalStatus" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlApprovalStatus_SelectedIndexChanged" > |
| <asp:ListItem Text="Pending" Value="False" Selected="True"></asp:ListItem> |
| <asp:ListItem Text="Approved" Value="True"></asp:ListItem> |
| </asp:DropDownList> |
| </EditItemTemplate> |
| <ItemStyle Width="40px" /> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id" |
| ReadOnly="True" SortExpression="id" UniqueName="id" Visible="false"> |
| <ItemStyle Width="100px" /> |
| </telerik:GridBoundColumn> |
| protected void ddlApprovalStatus_SelectedIndexChanged(object source, System.EventArgs e) |
| { |
| } |