 |
|
 |
Hi Mykola good article, I am having a question if i would like to merge the first cell instead of all what should I do..
|
|
|
|
 |
|
 |
Not sure that I understand your needs. Could you please post a sample of what you are trying to achieve?
|
|
|
|
 |
|
 |
Instead of merging each and every cell if I would like to merge only first cell, how can I do this..
|
|
|
|
 |
|
 |
>> to merge only first cell
What does it mean "to merge only first cell"? How can you merge single cell? Does it mean merging cells in the first column? Could you be more concrete?
|
|
|
|
 |
|
 |
Yeah i would like to merge only Manufacturer if duplicate exists
|
|
|
|
 |
|
 |
try to change
for (int i = 0; i < row.Cells.Count; i++)
{
if (row.Cells[i].Text == previousRow.Cells[i].Text)
{
row.Cells[i].RowSpan = previousRow.Cells[i].RowSpan < 2 ? 2 :
previousRow.Cells[i].RowSpan + 1;
previousRow.Cells[i].Visible = false;
}
}
to
if (row.Cells[0].Text == previousRow.Cells[0].Text)
{
row.Cells[0].RowSpan = previousRow.Cells[0].RowSpan < 2 ? 2 :
previousRow.Cells[0].RowSpan + 1;
previousRow.Cells[0].Visible = false;
}
|
|
|
|
 |
|
 |
Thanks Mykola
|
|
|
|
 |
|
|
 |
|
 |
Really useful, I used this in my project
|
|
|
|
 |
|
|
 |
|
 |
Simple and Elegant. Very Nice
|
|
|
|
 |
|
 |
Hi.
your Application is too good. but I want to do it in Windows Application Using WPF DataGrid. Same output i also required. So any help?
|
|
|
|
 |
|
 |
Sorry, I have never worked with WPF DataGrid. The above approach is based on HTML features and is not suitable for Windows controls.
|
|
|
|
 |
|
 |
First of all, great code!!
Is there a way to add alternating colors to each group?
Thanks.
|
|
|
|
 |
|
 |
Hi,
You can do something similar to this (not tested):
if (row.Cells[i].Text == previousRow.Cells[i].Text)
{
row.Cells[i].RowSpan = previousRow.Cells[i].RowSpan < 2 ? 2 :
previousRow.Cells[i].RowSpan + 1;
row.Cells[0].BackColor = System.Drawing.Color.FromArgb(random.Next(int.MaxValue))
previousRow.Cells[i].Visible = false;
}
where random is an instance of the Random class.
|
|
|
|
 |
|
 |
just wondering how can this be done for vs2003
thx
|
|
|
|
 |
|
 |
Replace GridView gridView by DataGrid dataGrid and use dataGrid.Items instead of gridView.Rows. Everything else should work.
|
|
|
|
 |
|
 |
many thanks. managed to get it to work.
|
|
|
|
 |
|
 |
i used the method in my application but i got a problem
|
|
|
|
 |
|
|
 |
|
 |
I suspect he created more then 1 account - I saw other votes at the same time with the same syntax and grammatical errors from the accounts opened today. I also saw something similar happening before
I wish there would be a way to block those guys and remove their voting - they just discourage people who make an effort to share their knowledge.
By the way great article, elegant solutions - thumbs up and 5 from me!
|
|
|
|
 |
|
 |
Thanks for the warm words about my work, the same I can say about yours.
Btw, I visited your site. Nice games!
|
|
|
|
 |
|
 |
I'm really sorry, i've made a big mistake. 4 from me
gstolarov wrote: I suspect he created more then 1 account - I saw other votes at the same time with the same syntax and grammatical errors from the accounts opened today. I also saw something similar happening before I wish there would be a way to block those guys and remove their voting - they just discourage people who make an effort to share their knowledge.By the way great article, elegant solutions - thumbs up and 5 from me!
|
|
|
|
 |
|
 |
I'm really sorry, i've made a big mistake. 4 from me
gstolarov wrote: I suspect he created more then 1 account - I saw other votes at the same time with the same syntax and grammatical errors from the accounts opened today. I also saw something similar happening before I wish there would be a way to block those guys and remove their voting - they just discourage people who make an effort to share their knowledge.By the way great article, elegant solutions - thumbs up and 5 from me!
|
|
|
|
 |
|
 |
Do not give negative ratings without trying something and without elaborating on what the problem is. Can you take some pains to let us know what is the error that you got?
|
|
|
|
 |