I have datatable and add the rows from textboxes in winform.How to display last added record in first row in datatable and blink(flash) that record in datatable?
I add this datatable to datagridview?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Feb 12, 2015, 7:20 AM
For blink go here
http://www.codeproject.com/Articles/20387/Cell-Blink-for-DataGridView
PradeepPosted Feb 12, 2015, 7:20 AM
Hi try this on GridView1_RowDataBound
for your first part bind the grid , order by descending from uniqueId.
function blinkGridViewRows()
{
var gridRef = document.getElementById('<%= GridView1.ClientID %>');
for (var i=0; i {
var bodyRef = gridRef.childNodes(i);
for (var j=0; j {
var trRef = bodyRef.childNodes(j);
if ( trRef.blinkingRow == 'Y' )
{
blinkElement(trRef.id);
}
}
}
}
window.onload = blinkGridViewRows;
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.ID = "Row_" + e.Row.RowIndex.ToString();
// Here I'm just determining the blinking rows by every other row...
if ( (e.Row.RowIndex % 2) == 0 )
e.Row.Attributes.Add("blinkingRow", "Y");
else
e.Row.Attributes.Add("blinkingRow", "N");
e.Row.Attributes.Add("blinkCounter", "0");
}
}