hi.
i am designing grid Dynamically like this with Detail Tables.
here i want the DatakeyNames to get the data for Detail Tables.
how can i get the DataKeyName("Client_ID") and how can i pass the DataKeyName to this function Accounts_FileAllocation_Report_Data().
can any one help me please.
Thank You.
Suresh K.
i am designing grid Dynamically like this with Detail Tables.
| 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 |
how can i get the DataKeyName("Client_ID") and how can i pass the DataKeyName to this function Accounts_FileAllocation_Report_Data().
can any one help me please.
Thank You.
Suresh K.