I'm new to Telerik WPF RadGridView, I have question:
1. I want to archive text wraping in RadGridView, but how ?
2. Can I set custom formatting for cell value? I have column long value type, but I want to display it as duration like 01:30.
I have writing IFormatProvider for it, but don't know how to attach it do RadGridView Column.
3. I want to display row number in RadGridView, how do I do that (example):
No. Name
1 A
2 B
4. Does RadGridView support saving and loading Layout?
Thx
1. I want to archive text wraping in RadGridView, but how ?
2. Can I set custom formatting for cell value? I have column long value type, but I want to display it as duration like 01:30.
I have writing IFormatProvider for it, but don't know how to attach it do RadGridView Column.
3. I want to display row number in RadGridView, how do I do that (example):
No. Name
1 A
2 B
4. Does RadGridView support saving and loading Layout?
Thx
5 Answers, 1 is accepted
0
Hi Fakhru,
1. The GridViewDataColumn class has a property TextWrapping which you could set to Wrap in order to achieve what you need.
2. You should use the DataFormatString property of the column.
3. You will need to add this index to your business object as a property or create a wrapper class around your business object if you cannot modify it. The property should be of type int and return the index of the data item in the data source.
4. Please consult the blog post of my colleague Vladimir Enchev in order to learn how to save and load settings.
Our examples located here are a great place to start learning about RadGridView, so I encourage you to take a look at them. They come with the full source code which is very helpful as well.
Kind regards,
Ross
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
1. The GridViewDataColumn class has a property TextWrapping which you could set to Wrap in order to achieve what you need.
2. You should use the DataFormatString property of the column.
3. You will need to add this index to your business object as a property or create a wrapper class around your business object if you cannot modify it. The property should be of type int and return the index of the data item in the data source.
4. Please consult the blog post of my colleague Vladimir Enchev in order to learn how to save and load settings.
Our examples located here are a great place to start learning about RadGridView, so I encourage you to take a look at them. They come with the full source code which is very helpful as well.
Kind regards,
Ross
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fakhru
Top achievements
Rank 2
answered on 28 Jul 2009, 02:50 PM
Any example or more clue on how to archive this:
===================
.
.
.
3. You will need to add this index to your business object as a property or create a wrapper class around your business object if you cannot modify it. The property should be of type int and return the index of the data item in the data source.
===================
===================
.
.
.
3. You will need to add this index to your business object as a property or create a wrapper class around your business object if you cannot modify it. The property should be of type int and return the index of the data item in the data source.
===================
0
Hi Fakhru,
You can use the attached sample application as a reference.
Best wishes,
Anastasia
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
You can use the attached sample application as a reference.
Best wishes,
Anastasia
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fakhru
Top achievements
Rank 2
answered on 30 Jul 2009, 11:50 AM
In the example when I do column sort, the line number also sorted.
What I want to do is:
No. Name
1 A
2 B
When sort using column Name, it will:
No. Name
1 B
2 A
Notice the column No will always reflect the row number.
I have other question, do WPF RadGridView have event to format value for column?
Thx
What I want to do is:
No. Name
1 A
2 B
When sort using column Name, it will:
No. Name
1 B
2 A
Notice the column No will always reflect the row number.
I have other question, do WPF RadGridView have event to format value for column?
Thx
0
Hi Fakhru,
You could try changing the RowLoaded event handler to:
Best wishes,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
You could try changing the RowLoaded event handler to:
void RadGridView1_RowLoaded(object sender, RowLoadedEventArgs e) |
{ |
if ((e.Row is GridViewRow) && !(e.Row is GridViewNewRow)) |
{ |
Grid rootGrid = e.Row.ChildrenOfType<Grid>()[0]; |
Person person = e.Row.DataContext as Person; |
var record = this.RadGridView1.FindRecord(person); |
var index = this.RadGridView1.Records.IndexOf(record); |
rootGrid.Children.Add(new TextBlock() { Text = index.ToString() }); |
} |
} |
Best wishes,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.