now it work on my site, just want to know, the data that display in my gridview is sort by
ascending, so i want to make the new insert hight light, see example below:, if this is diffucult, i will continue by using the code that has been given by your before this, but i really glad if you can help by doing as i explain..
Cristoper Michael
Cristopher
David Teo
David Tiong (New Data Insert), want to hightlight this data
afastars
Member
52 Points
221 Posts
Hight light Grid View When New Data Was Inserted
Dec 24, 2012 11:08 PM|LINK
hi all expertise
i want my gridview hight light yellow color when the new data was inserted,
i need to implement this because it will make the user confius which data is new and which data is old,
i hope expertise here can help me..
oned_gk
All-Star
31766 Points
6492 Posts
Re: Hight light Grid View When New Data Was Inserted
Dec 24, 2012 11:54 PM|LINK
If you are using ID autoincreament primary key, you can sort the data by ID desc. New record will always on top.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Hight light Grid View When New Data Was Inserted
Dec 26, 2012 12:24 AM|LINK
Hello,
GridView doesn't support inserting. So I think you can just:
1) Place several TextBoxes outside the GridView, and with a button beside.
2) Then when inserting a record successfully, please just set GridView.Rows[0].BackColor=Red or Yellow.
Reguards!
afastars
Member
52 Points
221 Posts
Re: Hight light Grid View When New Data Was Inserted
Dec 26, 2012 04:03 AM|LINK
hi decker thanks for reply
my insert form is different with the gridview, i already do it, but not work in my site,
i'm doing insert in register.aspx page, after that the user can view the success insertion in listUser.aspx
i put this code below in page_load
GridView.Rows[0].BackColor=Red or Yellow.
this code above just change the color the first rows of the gridview, if the new insertion go to row number 5, how it can be done..?
i display this grid view by using A-Z method
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Hight light Grid View When New Data Was Inserted
Dec 26, 2012 04:10 AM|LINK
Just change to this:
GridView.Rows[GridView.Rows.Count-1].BackColor=Red or Yellow;
afastars
Member
52 Points
221 Posts
Re: Hight light Grid View When New Data Was Inserted
Dec 26, 2012 05:30 AM|LINK
hi decker
now it work on my site, just want to know, the data that display in my gridview is sort by ascending, so i want to make the new insert hight light, see example below:, if this is diffucult, i will continue by using the code that has been given by your before this, but i really glad if you can help by doing as i explain..
Cristoper Michael
Cristopher
David Teo
David Tiong (New Data Insert), want to hightlight this data
Eric Liong
Eric Farnandez
oned_gk
All-Star
31766 Points
6492 Posts
Re: Hight light Grid View When New Data Was Inserted
Dec 26, 2012 05:38 AM|LINK
You need additional datasource to check the latest data, for example MAX(ID).
In Gridview rowdatabound event, compare the value with current row value. If equal then change row color.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Hight light Grid View When New Data Was Inserted
Dec 31, 2012 12:13 AM|LINK
Hi again,
Some ideas:
1) Please make sure that there's at least one identitied column stepped from 1 to 1.
2) After inserting, please find out the maxinum Id of your record in GridView's Rows, and then mark it colored.