We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to differntiate b/w parent and child columns?

Hi i have a dataset in which there are two table joined,i made it hirerechal in the grid in format say INVOICE NO 1 LINE NO 1, QTY,PRICE,.. INVOICE NO 2 LINE NO 1, QTY,PRICE,.. LINE NO 1, QTY,PRICE,.. ..... now if the user click on the INVOICE NO column i want to do something like moving to "INVOICE HEADER TAB" and if user clicks on any of the LINES then i want to move "LINES TAB" let me know is it possible ? i have done this with my datagrid in this way Dim i As Int16 = gridDataBoundGrid1.CurrentCell.RowIndex If i = -1 Then Else 'Dim rowcount As Integer = dgInvoiceHeader.CurrentCell.RowNumber ''Dim colCount As Integer = dgInvoiceHeader.CurrentCell.ColumnNumber Dim rowcount As Integer = i ''Dim cellvalue As String = dgInvoiceHeader.Item(rowcount, 0) If Not IsDBNull(gridDataBoundGrid1.Item(rowcount, 0).Text) Then Dim cellvalue As String = gridDataBoundGrid1.Item(rowcount, 2).Text Dim dataMember As String = gridDataBoundGrid1.DataMember 'Dim val As String = dgInvoiceHeader.Item(index, 0) Select Case dataMember Case Is = "InvNo" Me.tabCustomProcess.SelectedIndex = 3 Dim foundRow As Object foundRow = getRow("DETC_InvNo", cellvalue, dtInvDetails) ''SET DETC_ID o_7501.DETC_ID = IIf(Not foundRow(0)("DETC_ID") Is Nothing, foundRow(0)("DETC_ID"), "") Me.CtlInvoiceHeader1.InvLineID = o_7501.DETC_ID Me.CtlW7501AddLines1.InvLineID = o_7501.DETC_ID Case Is = "InvNo.InvHeaderToInvDetails" ''SET DETC_ID o_7501.DETC_ID = cellvalue Me.tabCustomProcess.SelectedIndex = 4 Me.CtlInvoiceHeader1.InvLineID = o_7501.DETC_ID Me.CtlW7501AddLines1.InvLineID = o_7501.DETC_ID Case Is = "InvDetails" ''SET DETC_ID o_7501.DETC_ID = cellvalue Me.tabCustomProcess.SelectedIndex = 4 Me.CtlInvoiceHeader1.InvLineID = o_7501.DETC_ID Me.CtlW7501AddLines1.InvLineID = o_7501.DETC_ID End Select DisplayInvoiceTotal() If SelectedDocument = "7501" Then CtlW7501AddLines1.ImporterID = CtlW75011.cbo_SHC_Importer_ID.SelectedValue CtlW7501AddLines1.EntryType = CtlW75011.cbo_CEC_TypeCode.getDisplayFieldValue("ETYC_Code") Else CtlW7501AddLines1.ImporterID = Ctl34611.cbo_SHC_Importer_ID.SelectedValue CtlW7501AddLines1.EntryType = Ctl34611.cbo_CEC_TypeCode.getDisplayFieldValue("ETYC_Code") End If ''Read the values of all ID's and Set in to the Class o_7501.DETC_InvNo = CtlInvoiceHeader1.txt_DETC_Invno.Text.Trim o_7501.SHC_ID = CtlW7501AddLines1.getSHC_ID o_7501.IRC_ID = CtlW7501AddLines1.getIRC_ID o_7501.CHC_ID = CtlW7501AddLines1.getCEC_ID End If End If

1 Reply

AD Administrator Syncfusion Team July 8, 2003 08:17 PM UTC

If I understand what you need, you can handle the CellClick event, and get the information there. One place to look for information like which hierarchy level you are on is to get the GridBoundRecordState for the clicked row. You can get the values directly from the grid. Here is a little code.
private void gridDataBoundGrid1_CellClick(object sender, .GridCellClickEventArgs e)
{
	GridBoundRecordState rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(e.RowIndex);
	Console.WriteLine("level: {0}   value in col 1: {1}", rs.LevelIndex, 
				this.gridDataBoundGrid1[e.RowIndex, 1].Text);
}

Loader.
Live Chat Icon For mobile
Up arrow icon