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

activating row

Thread ID:





3260 Mar 11,2003 10:02 AM UTC Mar 12,2003 11:37 AM UTC WinForms 4
Tags: GridControl
Dirk Puis
Asked On March 11, 2003 10:02 AM UTC

I am using the code from the Grid KnowledgeBase 5.1 to make a gridcontrol behave like a listbox: private void gridControl1_CurrentCellMoving(object sender, GridCurrentCellMovingEventArgs e) { e.ColIndex = 0; } private void gridControl1_CurrentCellActivating(object sender, GridCurrentCellActivatingEventArgs e) { e.ColIndex = 0; } Now however, I want to combine this with some code to activate the first row of the grid in my form load event: private void Form1_Load(object sender, System.EventArgs e) { this.gridControl1.Focus(); this.gridControl1.CurrentCell.MoveTo(1, 1, GridSetCurrentCellOptions.SetFocus | GridSetCurrentCellOptions.ScrollInView, false); } This combination doesn't seem to work. No row gets selected. Did I forget something here? regards, Dirk

Administrator [Syncfusion]
Replied On March 11, 2003 05:31 PM UTC

I may be missing something, but I think I tried your code in a GridControl on a form, and it seemed to work as expected. Attached is the sample. Are you doing something different or expecting something other than the first row to be highlighted?

Dirk Puis
Replied On March 12, 2003 06:29 AM UTC

Hmm, nope. The code is exactly the same and the effect as well. The only difference I see (since you are showing the rowheader and I am not) is that the first row does indeed become active. There is a slight pushed-down effect on the rowheader cell of the first row. But that effect is completely different from the effect you get when actually clicking in the first row (when the complete row becomes highlighted). That is the effect I'm trying to have on my form load. Attached is a jpeg that shows what I am seeing on screen.

Administrator [Syncfusion]
Replied On March 12, 2003 09:01 AM UTC

When I run the sample, I see the right screen immediately (with the selected row) without doing any clicking. What version of the grid are you using? I am using the (available for download from your support home page).

Dirk Puis
Replied On March 12, 2003 11:37 AM UTC

Yup, that did the trick. I was running Thanks


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon