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
close icon

DrawEvent for Grids

Hi,

I am working with V8.4.0.10,  and I implemented a Sparkline feature myself by using the DrawEvent for virtual grids.

It works fine, but when the grids are clicked, the Sparkline gets covered by a textbox.  I tried to set the grid unclickable or uneditable, but the Sparkline still gets covered.  Is there a way to make sure that the drawing in virtual grids is always there? 





8 Replies

RB Ragamathulla B Syncfusion Team August 2, 2012 04:12 AM UTC

Hi Jali,
 
Thank your for your interest in Syncfusion products,
 
I am afraid that I am unable to reproduce the issue. I would request your to provide a simple sample that replicate this issue which is helpful for us to provide better solution to you.
 
Let me know if you have any further concerns.
 
Regards,
Ragamathullah B.


JG Jiali Gao August 2, 2012 04:31 PM UTC

I have attached the demo. 

In the popup form, I'm hoping to fixed the right most column so that the Sparkline will not disappear when the gird is clicked.

Thank you for your help!


JialiApp2_syncfusionGrid_e6716f74.zip


RB Ragamathulla B Syncfusion Team August 2, 2012 06:56 PM UTC

Hi Jiali,
 
Thanks for the update.
 
You can avoid your reported issue by the following ways. Please refer to the following code.

//Way 1

// enable the pariticular column

void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

{

if (e.ColIndex == 11)

e.Style.Enabled =

false;

}

// way 2

//Restrict the editing mode in the particular column

void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)

{

if (this.gridControl1.CurrentCell.ColIndex.Equals(11))

{

e.Cancel =

true;

}

}

Please refer to the attached sample which illustrates the same.

Let me know if you have any further concerns.

Regards,

Ragamathullah B.



JG Jiali Gao August 3, 2012 01:25 PM UTC

Hi Ragamathullah,

Thank you for your help.  I tried both of the solution.  It works when I click on a single cell.  However,  if I select multiple cell at one time, the Sparklines stay in
the first two cells, but not the rest of them.   I'm wondering if there is a way to disable mouse selection as well.   So, when the user drag the mouse over these Sparkline cells, the drawing will not disappear.

Thank you for your help!

Best Regards,
Jiali


RB Ragamathulla B Syncfusion Team August 7, 2012 04:20 AM UTC

Hi Jiali,

 

Thanks for the update.

 

You can avoid that behavior by using RefreshRange(). Please refer to the following code.

void gridControl1_SelectionChanged(object sender, GridSelectionChangedEventArgs e)

        {

            this.gridControl1.RefreshRange(e.Range);

        }

 

Please refer to the following sample link.

 

http://www.syncfusion.com/downloads/Support/DirectTrac/96817/JialiApp2_syncfusionGrid-897174086.zip

 

Let me know if you have any further concerns.

 

Regards,

Ragamathullah B.



JG Jiali Gao August 14, 2012 12:54 PM UTC

Thank you for the help. That works out perfectly.

Also, I have a couple of more questions about the drawEvent.

In gridControl, I use default AccelerateScrolling, which result in a continuous scrolling.  When I scroll down, and then scroll up slowly,  some of the drawing in the grid disappear.  I'm not sure what is causing this.

Again, Thanks for your help!




JG Jiali Gao August 15, 2012 06:27 PM UTC

I use e.Cancel = true to fix the drawing.  It works fine now. Thank you.


RB Ragamathulla B Syncfusion Team August 15, 2012 11:19 PM UTC

Hi Jali,
 
We glad to help you out
 
Regards,
Ragamathullah B.

Loader.
Live Chat Icon For mobile
Up arrow icon