or
DataTable dtData =
new
DataTable();
dtData.Columns.Add(
new
DataColumn(
"Name"
,
typeof
(
string
)));
dtData.Columns.Add(
new
DataColumn(
"Value"
,
typeof
(
double
)));
DataRow drCost;
RadarLineSeries rs = new RadarLineSeries();
foreach (DataRow dr in dtData.Rows)
{
CategoricalDataPoint dp = new CategoricalDataPoint();
dp.Category = dr["Name"].ToString();
dp.Value = double.Parse(dr["Value"].ToString());
rs.DataPoints.Add(dp);
}
rs.Stroke = new SolidColorBrush(Color.FromRgb(37, 160, 219));
RadarChartDemo.Series.Add(rs);
public
void
GeneratingProperty(AutoGeneratingPropertyDefinitionEventArgs e)
{
try
{
AvailableProperties property = (AvailableProperties)Enum.Parse(
typeof
(AvailableProperties), e.PropertyDefinition.Binding.Path.Path);
if
(IsAvailable(item.GetAvailableProperties(), property))
{
switch
(property)
{
case
AvailableProperties.Title:
FrameworkElementFactory textBoxFactory =
new
FrameworkElementFactory(
typeof
(TextBox));
textBoxFactory.AddHandler(TextBox.TextChangedEvent,
new
TextChangedEventHandler(TitleTextChanged));
textBoxFactory.SetValue(TextBox.BackgroundProperty, System.Windows.Media.Brushes.Tomato);
textBoxFactory.SetValue(TextBox.BorderBrushProperty, System.Windows.Media.Brushes.Transparent);
textBoxFactory.SetBinding(TextBox.TextProperty,
new
Binding(
"Title"
));
DataTemplate template =
new
DataTemplate();
template.VisualTree = textBoxFactory;
template.Seal();
e.PropertyDefinition.EditorTemplate = template;
e.PropertyDefinition.OrderIndex = 0;
e.PropertyDefinition.DisplayName =
"Title"
;
e.PropertyDefinition.Description =
"The title of the attribute. Can only contain letters, numbers, and underscores."
;
break
;
default
:
// other properties go in case statements above here
break
;
}
}
else
{
e.Cancel =
true
;
}
}
catch
{
e.Cancel =
true
;
}
}
public
void
TitleTextChanged(
object
sender, TextChangedEventArgs e)
{
if
(sender
is
TextBox)
{
TextBox titleTextBox = (TextBox)sender;
int
caretIndex = titleTextBox.CaretIndex;
string
newValue = titleTextBox.Text;
item.Title = newValue;
ApplyCorrectedValue(newValue, item.Title, titleTextBox, caretIndex);
NotifyOfPropertyChange(() => MappingsPanel);
}
else
{
Logger.Log(
"TitleChanged: source must be a TextBox"
);
throw
new
ArgumentException(
"source must be a TextBox"
);
}
}
Hi ya, I'm trying to populate one RadGridView using an UDF Sql Server which waits a parameter but it doesn't work:
XAML:
<
telerik:RadGridView
x:Name
=
"dgvHistoricoOR"
HorizontalAlignment
=
"Left"
FontFamily
=
"Segoe UI"
FontSize
=
"12"
FontStyle
=
"Normal"
Margin
=
"10,44,-185,0"
VerticalAlignment
=
"Top"
Height
=
"175"
Width
=
"437"
ColumnWidth
=
"SizeToCells"
Grid.ColumnSpan
=
"2"
Grid.RowSpan
=
"2"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ord_repalpha}"
Header
=
"{Resx RadGridViewOr_Or}"
Width
=
"40"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding F_Alta}"
Header
=
"{Resx RadGridViewOr_Alta}"
Width
=
"60"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding F_Cierre}"
Header
=
"{Resx RadGridViewOr_Cierre}"
Width
=
"60"
/>
</
telerik:RadGridView.Columns
>
ada = New SqlDataAdapter("SELECT * FROM OR_Historico_Por_Cliente(@par1)", aBD.connection)
ada.SelectCommand.Parameters.AddWithValue("@par1", Documento)
ada.Fill(ds, "OR_Historico_Por_Cliente")
Me.dgvHistoricoOR.ItemsSource = "OR_Historico_Por_Cliente"
Me.dgvHistoricoOR.DataContext = ds
I don't get data, my Grid remains empty
I wonder, when I call Fill method, should I include the value for the parameter???
<
UserControl.Resources
>
<
Style
x:Key
=
"DraggableListBoxItem"
TargetType
=
"controls4:RadListBoxItem"
>
<
Setter
Property
=
"dragDrop:DragDropManager.AllowCapturedDrag"
Value
=
"True"
/>
<
Setter
Property
=
"dragDrop:DragDropManager.AllowDrag"
Value
=
"True"
/>
</
Style
>
</
UserControl.Resources
>
<
ListBox
Grid.Row
=
"2"
x:Name
=
"List1"
ItemsSource
=
"{Binding Source1, Mode=TwoWay}"
AllowDrop
=
"True"
IsSynchronizedWithCurrentItem
=
"True"
Style
=
"{StaticResource ListBoxStyleMenu}"
Margin
=
"2,2,2,2"
VerticalAlignment
=
"Stretch"
HorizontalContentAlignment
=
"Center"
HorizontalAlignment
=
"Stretch"
>
<
ListBox.ItemsPanel
>
<
ItemsPanelTemplate
>
<
UniformGrid
Columns
=
"2"
/>
</
ItemsPanelTemplate
>
</
ListBox.ItemsPanel
>
<
ListBox.ItemContainerStyle
>
<
Style
TargetType
=
"{x:Type ListBoxItem}"
>
<
Setter
Property
=
"Focusable"
Value
=
"False"
/>
<
Setter
Property
=
"Margin"
Value
=
"0,5,0,5"
/>
</
Style
>
</
ListBox.ItemContainerStyle
>
</
ListBox
>
<
ListBox
Grid.Row
=
"2"
x:Name
=
"List2"
ItemsSource
=
"{Binding Source2, Mode=TwoWay}"
AllowDrop
=
"True"
IsSynchronizedWithCurrentItem
=
"True"
Style
=
"{StaticResource ListBoxStyleMenu}"
Margin
=
"2,2,2,2"
VerticalAlignment
=
"Stretch"
HorizontalContentAlignment
=
"Center"
HorizontalAlignment
=
"Stretch"
>
<
ListBox.ItemsPanel
>
<
ItemsPanelTemplate
>
<
UniformGrid
Columns
=
"2"
/>
</
ItemsPanelTemplate
>
</
ListBox.ItemsPanel
>
<
ListBox.ItemContainerStyle
>
<
Style
TargetType
=
"{x:Type ListBoxItem}"
>
<
Setter
Property
=
"Focusable"
Value
=
"False"
/>
<
Setter
Property
=
"Margin"
Value
=
"0,5,0,5"
/>
</
Style
>
</
ListBox.ItemContainerStyle
>
</
ListBox
>
<
controls4:RadListBox
x:Name
=
"List3"
ItemsSource
=
"{Binding Source3}"
AllowDrop
=
"False"
SelectedItem
=
"{Binding SourceSelected, Mode=TwoWay}"
VerticalAlignment
=
"Stretch"
HorizontalContentAlignment
=
"Center"
HorizontalAlignment
=
"Stretch"
Margin
=
"2,2,2,2"
ItemContainerStyle
=
"{StaticResource DraggableListBoxItem}"
>
<
controls4:RadListBox.DragDropBehavior
>
<
behaviors:ListBoxDragDropBehavior
AllowReorder
=
"True"
dragDrop:DragDropManager.TouchDragTrigger
=
"TapAndHold"
/>
</
controls4:RadListBox.DragDropBehavior
>
</
controls4:RadListBox
>