Hi Rajagopal
1)thaks for your solution it works . but still a problem is that i want horizontal scrool bar that is not coming after applying this code means if i increase the size of column then the size of last column decreases , that is not our requirement.
Means if user want to increase the size of grid then there comes scroll bar automatically (Horizontal) , but in our case it reduce the last column size.
2) give me one more favour that pl'z send me the sample code of GridControl sort b'cas i am unable to get that in my samples , it's not there in my sample b'cas i'm using Ver. 4.5
Thanks in Advance
Gourav
>Hi Gourav,
Thanks for your interest in Syncfusion Products.
1. To remove the empty space after the last column, you could handle the grid.Model.QueryColWidth event and make the last column in the grid to fill the client area. Below are some code snippets.
bool fillLastCol = true;
void Model_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
int lastColIndex = this.gridControl1.ColCount;
if (this.fillLastCol && e.Index == lastColIndex)
{
int width = this.gridControl1.ColCount <= 0 ? 0 : this.gridControl1.Model.ColWidths.GetTotal(0, lastColIndex - 1);
e.Size = this.gridControl1.ClientRectangle.Width - width;
e.Handled = true;
}
}
Here is a sample that demonstrates this
http://www.syncfusion.com/Support/user/uploads/GC_FillCols_c8ff7b7c.zip2. By default, GridControl does not support sorting as GridDataBoundGrid and GridGroupingControl does, because sorting is being done through the IBindingList sort support of the datasource of the grid. However, you can follow the approach followed in our GridControlSort sample in the browser samples shipped with the product, which will help you to do sorting for gridcontrol also.
\\Syncfusion\EssentialStudio\5.1\Windows\Grid.Windows\Samples\2.0\FeatureSamples\GridControlSort
Let me know if you have any other questions.
Have a nice time.
Regards,
Rajagopal