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.

activating row

Thread ID:

Created:

Updated:

Platform:

Replies:

3260 Mar 11,2003 05:02 AM Mar 12,2003 06:37 AM Windows Forms 4
loading
Tags: GridControl
Dirk Puis
Asked On March 11, 2003 05:02 AM

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 12:31 PM

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 01:29 AM

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 04:01 AM

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 1.5.2.0 (available for download from your support home page).

Dirk Puis
Replied On March 12, 2003 06:37 AM

Yup, that did the trick. I was running 1.5.1.1. Thanks

CONFIRMATION

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.

;