Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
5760 | Jul 17,2003 01:03 AM UTC | Jul 17,2003 04:00 PM UTC | WinForms | 4 |
![]() |
Tags: GridControl |
’add the handler say in the form’s Load event AddHandler GridListControl1.Grid.QueryCellInfo, AddressOf HandleGridQueryCellInfo ’here is the handler that changes the title of column 1 to "NewTitle" Private Sub HandleGridQueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs) If e.ColIndex = 1 And e.RowIndex = 0 Then e.Style.Text = "NewTitle" ' for col 1 e.Handled = True End If EndSub
> ’add the handler say in the form’s Load event > AddHandler GridListControl1.Grid.QueryCellInfo, AddressOf HandleGridQueryCellInfo > > ’here is the handler that changes the title of column 1 to "NewTitle" > Private Sub HandleGridQueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs) > If e.ColIndex = 1 And e.RowIndex = 0 Then > e.Style.Text = "NewTitle" ' for col 1 > e.Handled = True > End If > EndSub >> >
this.gridDataBoundGrid1.Model.Options.DisplayEmptyRows = true;
3) You should handle Model.QueryColWidth and set the width to a size equal to 1/numCols times teh grid's client width. Here is a sample handler from the GridDataBoundImages sample that support this type of propertional sizing. One last comment is to set grid.SmoothControlResize = false so it draws ok as you size it through its parent.
private void GetColWidth(object sender, GridRowColSizeEventArgs e) { if(this.proportionalCellSizing && e.Index > 0) { e.Size = (int) ((this.gridDataBoundGrid1.ClientRectangle.Width - this.gridDataBoundGrid1.Model.ColWidths[0]) / (float)this.gridDataBoundGrid1.Model.ColCount); e.Handled = true; } }4) set the grid.ListBoxSelectionMode = SelectionMode.One. Also handle, grid.CurrentCellActivating, and in your handler, set e.ColIndex = 0.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.