Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Add Extra Row in datagrid at runtime in silverlight
WhatsApp
Priya Linge
13y
8.7
k
0
0
25
Blog
Introduction :
This blog shows how we can add extra row at runtime using loadingRow event in silverlight.
we can add rows at runtime using LoadingRow event in silverlight.
Example :
public MainPage()
{
dataGrid1.LoadingRow += new EventHandler<DataGridRowEventArgs>(dataGrid1_LoadingRow);
}
void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = e.Row.GetIndex() + 1;
}
Output looks like as following.
The Red mark is the row which added in datagrid.
We can also increase their indexing like,
e.Row.Header = e.Row.GetIndex() + 10;
Output.
We can set the style for this row in datagrid as below.
e.Row.HeaderStyle = (Style)Application.Current.Resources["myrow"];
Thanks.
Add Extra Row in datagrid at runtime in silverlight
Up Next
DataGrid.LoadingRow Event in silverlight
Ebook Download
View all
Printing in C# Made Easy
Read by 22.3k people
Download Now!
Learn
View all
Membership not found