or
<
Window
x:Class
=
"tlk_colorpicker.MainWindow"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
tlk:RadDropDownButton
Content
=
"Color"
x:Name
=
"color"
>
<
tlk:RadDropDownButton.DropDownContent
>
<
tlk:RadColorSelector
SelectedColorChanged
=
"PredefSelectedColorChanged"
NoColorVisibility
=
"Collapsed"
/>
</
tlk:RadDropDownButton.DropDownContent
>
</
tlk:RadDropDownButton
>
<
Rectangle
x:Name
=
"oRect"
Width
=
"50"
Height
=
"50"
Grid.Row
=
"2"
Fill
=
"AliceBlue"
/>
</
Grid
>
</
Window
>
private
void
PredefSelectedColorChanged(
object
sender, EventArgs e)
{
oRect.Fill =
new
SolidColorBrush(((RadColorSelector)sender).SelectedColor);
color.IsOpen =
false
;
}
public static void PrintPreview(GridViewDataControl source)
{
Window window = new Window();
window.Title = "Print Preview";
DocumentViewer documentViewer = new DocumentViewer();
PrintDialog printDialog = new PrintDialog();
printDialog.PageRangeSelection = PageRangeSelection.UserPages;
printDialog.UserPageRangeEnabled = true;
printDialog.MaxPage = 40;
documentViewer.Document = ToFixedDocument(ToPrintFriendlyGrid(source), printDialog);
window.Content = documentViewer;
window.ShowDialog();
}
Hi,
I have a scenario where I need to update the layout of a RadGridView when I change the width of a column from my ViewModel.
My first approach was to use the ColumnWidthChanged event, but it does not fire.
Is this intended behavior?
I could trigger the UpdateLayout() call from my ViewModel, but it does not belong there because it is entirely UI related stuff...
Any suggestions?
Best Regards,
Christian
private void btnFind_Click(object sender, RoutedEventArgs e) { btnFind.IsEnabled = false; scrollIntoFindIndex = 0; string searchText = txtFind.Text; dgDynGrid.SelectedItems.Clear(); foreach (object o in dgDynGrid.Items) { if (o is DataRowView) { for (int z = 0; z < (o as DataRowView).Row.ItemArray.Count(); z++) { try { string t = (o as DataRowView).Row.ItemArray[z].ToString(); if (t.IndexOf(searchText, StringComparison.InvariantCultureIgnoreCase) >= 0) { dgDynGrid.SelectedItems.Add(o); break; } } catch { //if it cant be converted to string, i will not find in this field } } } } btnFind.IsEnabled = true; ScrollIntoFind(0); } int scrollIntoFindIndex = 0; private void ScrollIntoFind(int i) { if (dgDynGrid.SelectedItems.Count > i) { dgDynGrid.ScrollIntoView(dgDynGrid.SelectedItems[i]); } else { scrollIntoFindIndex = 0; MessageBox.Show("Završila je pretraga, idučim klikom se pretražuje od početka", "Kraj pretrage", MessageBoxButton.OK, MessageBoxImage.Information); } } private void btnFindNext_Click(object sender, RoutedEventArgs e) { scrollIntoFindIndex++; ScrollIntoFind(scrollIntoFindIndex); }