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.

GridListControl - Win32 API SendMessage Call Problem

Thread ID:

Created:

Updated:

Platform:

Replies:

40281 Jan 30,2006 11:10 AM Oct 11,2006 08:27 AM Windows Forms 7
loading
Tags: GridControl
Badri Rajani Kanth
Asked On January 30, 2006 11:10 AM

HI, In a windows listbox control, if I use Win32 API SendMessage to findstring, it will highlight the found item and also display that item as the first item. I mean, it will apply scrolling to show the item at top. Plz check with below code to observe this behaviour. using System.Runtime.InteropServices; [DllImport("user32.dll", CharSet=CharSet.Auto)] static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, string lParam); IntPtr x = SendMessage(listBox1.Handle, LB_FINDSTRING, -1, textBox1.Text); listBox1.SelectedIndex = x.ToInt32(); However, I am trying to get a custom list box (from GridListControl with one column). But SendMessage seems to be not working as listed above. Any help plz.. Rgds Rajani Kanth

Administrator [Syncfusion]
Replied On January 31, 2006 06:38 AM

Hi Badri, The behavior of SendMessage can be achieved by using the FindItem or FindString method. Here is a sample. Regards, Calvin.

CS7.zip

Badri Rajani Kanth
Replied On February 1, 2006 12:16 PM

Hi Cavin, Try with below code: private void textBox1_TextChanged(object sender, System.EventArgs e) { ListBox1.FindItem(this.textBox1.Text,true,0,true); uint LB_FINDSTRING = 0x018F; IntPtr x = SendMessage(this.listBox2.Handle, LB_FINDSTRING, -1, textBox1.Text); listBox2.SelectedIndex = x.ToInt32(); SendMessage(ListBox1.Handle,WM_VSCROLL ,SB_PAGETOP,0); SendMessage(listBox2.Handle,WM_VSCROLL ,SB_PAGETOP,0); for(int i=0; iHi Badri, > >The behavior of SendMessage can be achieved by using the FindItem or FindString method. Here is a sample. > >Regards, >Calvin.

CS7.zip

Badri Rajani Kanth
Replied On February 1, 2006 12:23 PM

Hi, Plz see the updated sample with problem & solution. May be you can give small issues like this as features/articles so that new comers like me can use directly. Rgds Rajani Kanth

CS70.zip

Badri Rajani Kanth
Replied On April 11, 2006 09:38 AM

Hi, We are using Syncfusion 3.2.1.0 controls. Sometime back you people gave me a sample using GridListControl. When I run and click on gridlist control(right hand side one), the control displays a Big Red X mark. Our client has got this kind of error in DateTimePicker control. To reproduce the same, today we run many syncfusion controls and could see same error in your sample. Plz Go to: http://64.78.18.34/Support/Forums/message.aspx?MessageID=40281 You can find this erraneous sample in reply message given to me by Calvin [Syncfusion] . Rgds Badri Rajani Kanth ============================================== >Hi, > >Plz see the updated sample with problem & solution. May be you can give small issues like this as features/articles so that new comers like me can use directly. > >Rgds >Rajani Kanth

CS70.zip

Administrator [Syncfusion]
Replied On April 12, 2006 06:06 AM

Hi Badri, I regret really for the inconvenience caused. Since the sample that posted in this forum thread was not created in the grid version 3.2 I was not able to see the mentioned issue. But now, when checked the sample in version 3.2 I noticed that the issue is because of calling the Style.ResetBorders() in the DrawCell event handler. So replacing the e.Style.ResetBorders() to e.Style.Borders.All = new GridBorder(GridBorderStyle.None) works fine without any error. Please find the modified code below. But the Style.ResetBorders() works fine in the 3.3 and above versions. The red X suggests that an exception is being thrown during the Paint. You can set the debugger to stop on exception and try to see if the call stack may give some clue. Also refer to this KB article to know more about the red X issue. private void Grid_DrawCell(object sender, GridDrawCellEventArgs e) { GridControl grid = sender as GridControl; if(e.RowIndex != -1 && e.ColIndex != -1) { if(grid.CurrentCell.HasCurrentCellAt(e.RowIndex)) { //e.Style.ResetBorders(); e.Style.Borders.All = new GridBorder(GridBorderStyle.None); if(grid.Focused) { e.Style.BorderMargins.Top = 1; if(e.ColIndex == this.ListBox1.ImageColumn) e.Style.BorderMargins.Left = 2; } } } } Regards, Calvin.

Badri Rajani Kanth
Replied On April 12, 2006 10:40 AM

Thank You Cavin, As I explained earlier, we are getting this error in DateTimePickerAdv control also. But there we are NOT handling any of the paint routines. We guess similer is the case with that control also. There can be some deprecated methods. Can you plz list me some methods of DateTimePickerAdv which can cause this error. As we are getting this error on client machine, we could not get much debugging info. Rgds Rajani Kanth

Liam Reilly
Replied On October 11, 2006 08:27 AM

Any word on a solution to this issue as we are having a similar problem with the Red X

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.

;