We have custom columns in our gridviews as one below. When exporting to Excel, the key values are exported instead of displays values.
<
lookups:GridViewProjectLookupColumn
Header
=
"Project Number"
DataMemberBinding
=
"{Binding ProjectRecId}"
DisplayMemberBinding
=
"{Binding Project_ProjectRecId}"
DisplayMemberPath
=
"ProjId"
SortMemberPath
=
"Project_ProjectRecId.ProjId"
FilterMemberPath
=
"Project_ProjectRecId.ProjId"
ProjectTypeVisible
=
"False"
CustomerAccountVisible
=
"False"
ProjectStageVisible
=
"False"
IsReadOnlyBinding
=
"{Binding IsManualReadOnly}"
/>
Thanks,
Rūta
I have a RadGridView and I've used the article located at: http://docs.telerik.com/devtools/wpf/controls/radgridview/style-selectors/rowstyleselector for styling the row Foreground color. Everything works great except the Alternate Rows have the same color as the "regular" (non-alternate) rows.
I use the "BasedOn" attribute of the style to use the loaded theme (expression_dark) and I thought I would create a second style just for the alternate rows.
Here is the style code:
<
Grid.Resources
>
<
my:WorkListStyle
x:Key
=
"WorkListStyle"
>
<
my:WorkListStyle.ViewItem
>
<
Style
TargetType
=
"telerik:GridViewRow"
BasedOn
=
"{StaticResource GridViewRowStyle}"
>
<
Setter
Property
=
"Foreground"
Value
=
"Yellow"
/>
</
Style
>
</
my:WorkListStyle.ViewItem
>
</
my:WorkListStyle
>
<
my:WorkListAltStyle
x:Key
=
"WorkListAltStyle"
>
<
my:WorkListAltStyle.ViewItem
>
<
Style
TargetType
=
"telerik:GridViewRow"
BasedOn
=
"{StaticResource GridViewAlternateRowStyle}"
>
<
Setter
Property
=
"Foreground"
Value
=
"Yellow"
/>
</
Style
>
</
my:WorkListAltStyle.ViewItem
>
</
my:WorkListAltStyle
>
</
Grid.Resources
>
Then, in the RadGridView, I set these two options:
RowStyleSelector="{StaticResource WorkListStyle}"
AlternateRowStyleSelector="{StaticResource WorkListAltStyle}"
However, I get a run-time error when the xaml is parse on the "GridViewAlternateRowStyle" in the BasedOn attribute. Is there a different StaticResource I should be using? Thank you.
Dear Devexpress,
We are using your Gridview for WPF version 2015.1.225.40.
We have a problem :
for all columns we have a CellTemplate and a CellEditTemplate. The CellTemplate displays a value(sum) and is always read only.
The CellEditTemplate contains 2 textboxes were 2 separate values can be entered.
When those 2 Textboxes in the CellEditTemplate are read-only, there is still a way to enter a value., Why ?
How is it possible ? By selecting a column by mouse. Just one click on it.( It may not go in CellEditTemplate ). Then press a key (fe 2). Result => the readonly textbox contains now a 2 !
This may not happen.
Is there a solution to fix this problem ?
I have put the exemple code in a attached file. When the CanEdit1 property is set to false the problem occurs.
regards,
Gert
Hi,
I want similar editor as RadBrowseEditor in WPF where I can default path to open while opening the file dialog.Is there any similar editor in WPF controls or Is there any alternative??
Regards,
Nagasree.
I'm trying to override or remove the ability to click directly on the content of a DesktopAlert. My problem is that when you set the alert's content to a plain string, it acts as a link-button and upon clicking the text, it will close the window. This is a problem since there are certain DesktopAlerts that I don't want to be closed at all. I can set it as Enabled = False but then the dropdown menu and other parts of the alert quit functioning. This is all created from code behind so it is a little harder for me to set any properties or templates for it in XAML. I thought perhaps I should post in this forum and see if there is a way to not only remove the ability to click the content, but also to remove/override events in code-behind in general for WPF controls created server-side.
Dim
mainAlert =
New
RadDesktopAlert()
With
{
.Header =
"Messages"
,
.Content =
"You have "
& unreadCount &
" new messages"
,
.Height = 75,
.Width = 300,
.IconTemplate = TryCast(Application.Current.FindResource(
"radIconTemplate"
), DataTemplate),
.IconColumnWidth = 30,
.IconMargin =
New
Thickness(5, 10, 15, 0),
.CanAutoClose =
False
,
.ShowCloseButton =
False
,
.Tag =
"main"
,
.ShowMenuButton =
True
,
.MenuItemsSource = GetDesktopAlertMenuItems
}
manager.ShowAlert(mainAlert)
Hi to all,
I would using ComboBox in specific behavior:
I populate ItemSource with List<MyModel>, OK.
I have to use IsEditable, IsFilteringEnabled, TextSearchMode that allow me to search through items.
When I want to select an item, I click on it. (Selection item not must be automatic)
After that I'll clear selecteditem.
Can I do it?
I tryed with MouseLeftButtonDown event but it doesn't fire.
I have a RadCartesianChart with a DateTimeContinuousAxis.
Is it possible to specify a zoom level based on a timespan?
So that I only see 10 minutes of the chart - even when adding more data. And off course being able to pan through the rest of the chart.
/Flemming Rosenbrandt
Hi,
I have the following RadGridView where its ItemsSource which is bound to a collection that its item is inherited from DynamicObject.
As shown in the screenshot, how can i prevent the column name with "." being truncated in TryGetMember() method?
<
telerik:RadGridView
Grid.Row
=
"1"
Margin
=
"4"
GroupRenderMode
=
"Flat"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
CanUserFreezeColumns
=
"False"
ItemsSource
=
"{Binding TestResultRecords, Mode=OneWay}"
AutoGenerateColumns
=
"True"
IsReadOnly
=
"True"
CanUserReorderColumns
=
"False"
CanUserInsertRows
=
"False"
CanUserDeleteRows
=
"False"
behavior:MyScrollIntoViewAsyncBehavior.IsEnabled
=
"{Binding IsScrollToView, Mode=OneWay}"
>
<
telerik:RadGridView.SortDescriptors
>
<
telerik:SortDescriptor
Member
=
"{x:Static res:UIStringTable.DutCnt}"
SortDirection
=
"Ascending"
/>
</
telerik:RadGridView.SortDescriptors
>
</
telerik:RadGridView
>
TestResultRecords = new ObservableCollection<
VolatileDynamicColRecord
>();
m_TestRecord = new VolatileDynamicColRecord();
m_TestRecord["Sweep Voltage1-@2.5mA(V)"] = 1234
m_TestRecord["Sweep Voltage1-@2.8mA(V)"] = 5678
m_TestRecord["Sweep Voltage1-Item3(V)"] = 2.74353
TestResultRecords.Add(m_TestRecord);
public class VolatileDynamicColRecord : DynamicObject, INotifyPropertyChanged
{
private readonly IDictionary<
string
, object> m_Data;
public VolatileDynamicColRecord()
{
m_Data = new Dictionary<
string
, object>();
}
public VolatileDynamicColRecord(IDictionary<
string
, object> source)
{
m_Data = source;
}
public override IEnumerable<
string
> GetDynamicMemberNames()
{
return m_Data.Keys;
}
public IEnumerable<
object
> GetDynamicMemberValues()
{
return m_Data.Values;
}
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
// Note: when column name contains ".", the text after "." will be truncated.
result = this[binder.Name];
return result != null ? true : false;
}
public override bool TrySetMember(SetMemberBinder binder, object value)
{
if (this[binder.Name] == null)
{
return false;
}
this[binder.Name] = value;
return true;
}
public object this[string columnName]
{
get
{
if (m_Data.ContainsKey(columnName))
{
return m_Data[columnName];
}
return null;
}
set
{
if (!m_Data.ContainsKey(columnName))
{
m_Data.Add(columnName, value);
OnPropertyChanged(columnName);
}
else
{
if (m_Data[columnName] != value)
{
m_Data[columnName] = value;
OnPropertyChanged(columnName);
}
}
}
}
private void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
#endregion