DataGridView customization
-
Hello fellow coders. I'm having a hard time figuring out very easy thing with the datagridview so here is a screen of it in my program: datagrid My 2 questions are, I think, easy, but I can't find any solution and Google isnt helping me at all: - How to get ride of the left column (the one with the cursor that shows the selected rows), or at least, how to resize it to make it a fixed size ? - How to make column headers clickable? Currently in my program, the columns are not clickable and this is quite a huge issue for sorting things out. That followed with a 2nd question: how to programatically display a sorting glyph to the column header? Thank you!
-
Hello fellow coders. I'm having a hard time figuring out very easy thing with the datagridview so here is a screen of it in my program: datagrid My 2 questions are, I think, easy, but I can't find any solution and Google isnt helping me at all: - How to get ride of the left column (the one with the cursor that shows the selected rows), or at least, how to resize it to make it a fixed size ? - How to make column headers clickable? Currently in my program, the columns are not clickable and this is quite a huge issue for sorting things out. That followed with a 2nd question: how to programatically display a sorting glyph to the column header? Thank you!
Tony_P wrote:
- How to get ride of the left column (the one with the cursor that shows the selected rows), or at least, how to resize it to make it a fixed size ?
set
RowHeadersVisible
property to false, and to resize it, DGV have a property namedRowHeadersWidth
Tony_P wrote:
How to make column headers clickable? Currently in my program, the columns are not clickable
what you wanna say ?? default is clickable
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can
-
Tony_P wrote:
- How to get ride of the left column (the one with the cursor that shows the selected rows), or at least, how to resize it to make it a fixed size ?
set
RowHeadersVisible
property to false, and to resize it, DGV have a property namedRowHeadersWidth
Tony_P wrote:
How to make column headers clickable? Currently in my program, the columns are not clickable
what you wanna say ?? default is clickable
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can
set RowHeadersVisible property to false, and to resize it, DGV have a property named RowHeadersWidth Thank you! what you wanna say ?? default is clickable Well I'm feeding my datagridview with a SqlCeResultSet (through a BindingSource) and autogeneratecolumns set to true so I guess everything is default but still the column headers are not clickable. They are like standard labels.
SqlCeResultSet rs = functionThatReturnsAResultSet(); this.dataGridView1.AutoGenerateColumns = true; this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.bindingSource1.DataSource = rs; this.dataGridView1.DataSource = this.bindingSource1;
I confirm column headers are not clickable. -
set RowHeadersVisible property to false, and to resize it, DGV have a property named RowHeadersWidth Thank you! what you wanna say ?? default is clickable Well I'm feeding my datagridview with a SqlCeResultSet (through a BindingSource) and autogeneratecolumns set to true so I guess everything is default but still the column headers are not clickable. They are like standard labels.
SqlCeResultSet rs = functionThatReturnsAResultSet(); this.dataGridView1.AutoGenerateColumns = true; this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.bindingSource1.DataSource = rs; this.dataGridView1.DataSource = this.bindingSource1;
I confirm column headers are not clickable.try this :
DGV.Columns[0].SortMode = DataGridViewColumnSortMode.Automatic;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can
-
try this :
DGV.Columns[0].SortMode = DataGridViewColumnSortMode.Automatic;
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can
Still no difference. I'm investigating on it but I can't find any help. Could this be a problem with SqlCeResultSet or the fact that I have an "ORDER BY" statement in my SQL query giving the ResultSet?
-
Still no difference. I'm investigating on it but I can't find any help. Could this be a problem with SqlCeResultSet or the fact that I have an "ORDER BY" statement in my SQL query giving the ResultSet?
i think its cause is binding, you have bound the DGV
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can
-
i think its cause is binding, you have bound the DGV
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can
I see. I've tryed to recreate a new DGV and fill it with a simple "SELECT * FROM" query but still got the same results. Is there any way to make the column clickable even though data is bound (so I could handle the "ColumnClick" events) ? In fact, I've tried to add a HeaderMouseClick event to my DGV and it's handled properly, but still the headers don't act like they're clickable (ie: they act like labels, not buttons).
-
I see. I've tryed to recreate a new DGV and fill it with a simple "SELECT * FROM" query but still got the same results. Is there any way to make the column clickable even though data is bound (so I could handle the "ColumnClick" events) ? In fact, I've tried to add a HeaderMouseClick event to my DGV and it's handled properly, but still the headers don't act like they're clickable (ie: they act like labels, not buttons).
dunno :doh: , i will suggest you to add rows manually
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can