DataGridView Glyphs

J

jw56578

Is anyone aware of a way to make multiple glyphs show up.
I"ve set all column's sortmode to programmatic and assigned each
column a sort glyph direction, but only the first one shows up
 
C

ClayB

You can force the sort glyph to paint by setting th eproperty in the
CellPainting event.

void dataGridView1_CellPainting(object sender,
DataGridViewCellPaintingEventArgs e)
{
if (e.RowIndex == -1 && e.ColumnIndex > -1)
{

dataGridView1.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection =
SortOrder.Ascending;
}
}

The above code sets all the glyphs in the same direction. You would
need to track the columns and directions and specifically set the
glyphs you want to see.

=====================
Clay Burch
Syncfusion, Inc.
 
J

jw56578

that works perfectly on that event, but it is not succesfull when
called on the OnColumnHeaderMouseClick event


protected override void
OnColumnHeaderMouseClick(DataGridViewCellMouseEventArgs e)
{
if (e.RowIndex == -1 && e.ColumnIndex > -1)
{

dataGridView1.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection =
SortOrder.Ascending;
}
}

which is when i would like the glyphs to appear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top