BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Soren,
Sorry for the
delay caused.
We have analysed
your requirements. You can achieve your requirement to show the details for the
currently selected row by using cell click event as follows.
Code
Snippet[C#]:
void
dataGrid_CellClick(object sender,
Syncfusion.Windows.Controls.Grid.GridCellClickEventArgs
e) { int
recordindex = this.dataGrid.Model.ResolveIndexToRecordPosition(e.RowIndex);
dataGrid.Model.Table.ExpandDetailsViewAt(recordindex); }
|
And there is no
direct support for hiding expand collapse cell. We have prepared a workaround
to achieve your requirement. You can refer the following code snippet for this.
Code
Snippet[C#]:
void
ColumnWidths_LineSizeChanged(object sender,
Syncfusion.Windows.Controls.Scroll.RangeChangedEventArgs
e) { if
(dataGrid.Model.Table.HasDetailsView) { if
(e.NewSize == GridDataTableModel.ExpandCollapseCellWidth) { if
(dataGrid.ShowRowHeader && e.From == 1) dataGrid.Model.ColumnWidths[1]
= 0; if
(!dataGrid.ShowRowHeader && e.From == 0)
dataGrid.Model.ColumnWidths[0] = 0; } } }
|
We have prepared
a sample based on your requirements and please find the sample in the following
location.
Please let us
know if you have any queries.
Regards,
Thangapriya
On the click, i want to achieve two behaviors:
1) Expanding detail view on click, if it is closed. This is happening now.
2) Collapsing the detail view if i click on the row again, if the detail view is opened. Can you help with this?
Hi
Ankesh,
Thanks
for your update,
We have analyzed
your query. You can collapse the detail view while click on the row if detail view
opened by using IsDetailsViewExpanded API.
You can refer
the below code snippet.
Codesnippet[C#]:
dataGrid.CellClick
+= dataGrid_CellClick;
void
dataGrid_CellClick(object sender,
Syncfusion.Windows.Controls.Grid.GridCellClickEventArgs
e) { int
recordindex = this.dataGrid.Model.ResolveIndexToRecordPosition(e.RowIndex); var
nodeentry = this.dataGrid.Model.View.Records[recordindex]
as GridDataRecord; if (nodeentry.IsDetailsViewExpanded) dataGrid.Model.Table.CollapseDetailsViewAt(recordindex); else dataGrid.Model.Table.ExpandDetailsViewAt(recordindex); }
|
Please let us
know if this solution helps you,
Regards,
Saravanan.M