or
Public
Class
PageViewLocalizationProvider
Inherits
Telerik.WinControls.UI.RadPageViewLocalizationProvider
Public
Overrides
Function
GetLocalizedString(
ByVal
id
As
String
)
As
String
Return
SharedLocalizationManager.GetLocalizedString(id)
End
Function
End
Class
Telerik.WinControls.UI.RadPageViewLocalizationProvider.CurrentProvider =
New
PageViewLocalizationProvider()
radGridView1.DataSource =
null;
radGridView1.DataSource = m_Deals;
I was assuming that setting the DataSource to null would clear the grid of data before each reload.
Depending on how much data is there, after a certain time I get an Out of Memory exception.
Can you advise the best way to prevent this on periodic reloads of the Grid ?
Martin
private
void
ChangeFont()
{
for
(
int
i = 0; i < DgrdCustomerMaster.Rows.Count; i++)
{
for
(
int
j=0;j<DgrdCustomerMaster.Rows[i].Cells.Count; j++)
{
DgrdCustomerMaster.Rows[i].Cells[j].Style.Font =
new
Font(DgrdCustomerMaster.Rows[i].Cells[
"dgrdFont"
].Value.ToString(), 10); ;
}
}
}
private
void
DgrdCustomerMaster_CellFormatting(
object
sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
// e.CellElement.Font = new Font("Marathi Sharda", 10);
ChangeFont();
}
<
UserControl
x:Class
=
"MySampleClass"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
telerik:RadGridView
Grid.Column
=
"0"
Grid.Row
=
"0"
x:Name
=
"MainGridView"
ItemsSource
=
"{Binding Path=MetricsData}"
AutoGenerateColumns
=
"False"
CanUserDeleteRows
=
"False"
CanUserInsertRows
=
"False"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Visible"
SelectionMode
=
"Extended"
SelectionUnit
=
"Cell"
IsFilteringAllowed
=
"False"
SelectedCellsChanged
=
"MainGridView_SelectedCellsChanged"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"ColA"
Name
=
"Mkt"
DataMemberBinding
=
"{Binding Path=Market, Mode=OneWay}"
IsResizable
=
"False"
IsSortable
=
"False"
IsReadOnly
=
"True"
/>
<
telerik:GridViewDataColumn
Header
=
"ColB"
Name
=
"SiD"
DataMemberBinding
=
"{Binding Path=Sub1, Mode=OneWay}"
IsResizable
=
"False"
IsSortable
=
"False"
IsReadOnly
=
"True"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
UserControl
>