DrawEvent for Grids
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?
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
//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.
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
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.
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!
- 8 Replies
- 2 Participants
-
JG Jiali Gao
- Jul 26, 2012 08:10 PM UTC
- Aug 15, 2012 11:19 PM UTC