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.
Unfortunately, activation email could not send to your email. Please try again.

few things

Thread ID:





89377 Aug 23,2009 05:19 AM Aug 26,2009 04:53 AM Windows Forms 3
Tags: Tools
Asked On August 23, 2009 05:19 AM

Hello, everyone

I'd like to know 3 things about grid and form control:

1. How can I create grid control which has columns with AutoSizeMode = Fill?
2. How can I create grid control with only one visible column and with out rowheader (grd.colwidths(0) = 0 and grd.colwidths(1) = 180), that act like ListBox in the same manner, when you click some row, the whole row will be selected (actually, the only cell which is visible). I tried to use AllowSelection = Row, and it didn't work.
3. I used the example CustomOffice2007Colors_2005 with Group Bar in the right side of the form as mdi. When I select some label to open form in the left side, everything works well, but when I resize the whole form, the form that I have chosen inside the mdi, doesn't resize as well. I tried to use:

Private Sub Form1_SizeChanged() Handles Me.SizeChanged
CurrentForm.WindowState = FormWindowState.Normal
CurrentForm.StartPosition = FormStartPosition.Manual
Me.Panel1.Dock = DockStyle.Fill 'the panel which contains forms
CurrentForm.Dock = DockStyle.Fill
End Sub

and it didn't work out.

It will be very nice, if someone would help me, even in some questions from those 3 which I wrote above

Thanks in advance

Replied On August 23, 2009 05:53 AM

Hello, everyone

I found solution for question no. 2. I did something with grd_CellClick, which save the last selected row and return its color to the gird's backcolor.

It'll be nice, if somebody will give some clue about the other 2 questions.


Lingaraj S [Syncfusion]
Replied On August 26, 2009 02:01 AM

Hi Allon,

Thank you for your interest in Syncfusion products.

If you want the AutoFill columns in GridControl, then please try using QeueryColWidth event in GridControl to achieve this behavior.

Refer the code below:

// C# code
void gridControl1_QueryColWidth(object sender, GridRowColSizeEventArgs e)
if (e.Index > 0)
e.Size = (this.gridControl1.ClientSize.Width-this.gridControl1.ColWidths[0]) / this.gridControl1.ColCount;
e.Handled = true;
//VB code
Private Sub gridControl1_QueryColWidth(ByVal sender As Object, ByVal e As GridRowColSizeEventArgs)
If e.Index > 0 Then
e.Size = (Me.gridControl1.ClientSize.Width-Me.gridControl1.ColWidths(0)) / Me.gridControl1.ColCount
e.Handled = True
End If
End Sub

Refer the sample from below link:

Please let me know if you have any queries.

Lingaraj S.

Replied On August 26, 2009 04:53 AM

Ligaraj S., Thanks a lot.



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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.