Hi
Please find my below code showing the celledittemplate
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<tbcontrols:SmartSearchRadAutoCompleteBox x:Name="JournalSuggestions" AutomationProperties.AutomationId="JournalSuggestions"
Style="{StaticResource SmartControlStyle}"
SelectionMode="Single"
KeyDown="JournalSuggestions_KeyDown"
PreviewGotKeyboardFocus="JournalSuggestions_PreviewGotKeyboardFocus"
Populating="JournalSuggestions_Populating"
Width="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewDataColumn}, Path=ActualWidth}"
BorderThickness="0"
BorderBrush="Transparent"
ClipToBounds="True"
AutoCompleteMode="Suggest"
ItemsSource="{Binding Source={StaticResource SmartJournalAccounts}}"
DisplayMemberPath="Code"
FilteringBehavior="{StaticResource LocalJournalFilter}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
DropDownItemTemplate="{Binding Source={StaticResource CustomDropDownTemplate}}"
NoResultsContentTemplate="{StaticResource NoResultsContentTemplate}"
DropDownWidth="Auto"
BoxesItemStyle="{StaticResource CustomRadAutoCompleteBoxesItemStyle}"
IsEnabled="True"
Margin="-17 0 0 0"
SearchText="{Binding DataContext.SmartControlSearchText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}"
SelectedItem="{Binding Path=SmartJournalAccountItem, Mode=TwoWay}"
TextSearchMode="Contains" TextBoxStyle="{StaticResource TrailBalanceAccountTextBoxStyle}" FontSize="12" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cal:ActionMessage MethodName="AutoCompleteBoxSelectionChanged">
<cal:Parameter Value="{Binding SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadAutoCompleteBox}}}"></cal:Parameter>
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
<i:Interaction.Behaviors>
<behaviours:RadAutoCompleteBoxBehavior/>
</i:Interaction.Behaviors>
</tbcontrols:SmartSearchRadAutoCompleteBox>
<Button x:Name="SearchButton" Grid.Column="1"
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=controls:APTPanel}}"
Click="SearchButton_Click">
<Button.Visibility>
<con:ConverterBindableBinding Binding="{Binding IsSearchAccountVisible,UpdateSourceTrigger=PropertyChanged}"
Converter="{StaticResource BooleanToVisibilityConverter}"
ConverterParameterBinding="{Binding IsSearchAccountVisible, RelativeSource={RelativeSource AncestorType={x:Type controls:APTPanel}}, UpdateSourceTrigger=PropertyChanged}">
</con:ConverterBindableBinding>
</Button.Visibility>
</Button>
</Grid>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
If I click the "SearchButton" on first click the event does not fire, the click event fires if I click it second time.
If I remove the SmartSearchRadAutoCompleteBox control & only keep the SearchButton then it works ok.
Can someone give me code snippet having multiple controls (one radautosearchbox & one button) in datatemplate of celledittemplate or help me understand what is causing issue in my Click event
Regards,
Swapnil.
Hi,
I have a RadGridView in WPF where I use CustomGrouping for displaying it as a hierarchical structure. I set on it AutoExpandGroups="True" in order to be expanded by default. My problem is, if I manually collapse something in the RadGridView and I make an update to the list bounded to ItemsSource, the RadGridView automatically expands and does not stay as it was.
Thanks
I've read this thread but it is a bit confusing and old: Live sorting/grouping in UI for WPF | Telerik Forums
What is the current situation?
I am having problems with Devexpress GridControl as they dont support what they call "Live Data Shaping" eg sorting with real-time updates IF you use WPF binding.
Question - can Telerik data grid and/or virtual grid do live data shaping where columns use custom templates with WPF binding to a dictionary. For example: `{Binding Fields[abc].Value}`?
There's probably just a property for this that I am missing.
I have a RadGridView with SelectionUnit="FullRow" but it still draws a box around whatever cell I click on.
I can confirm that it doing the full row selection because it will copy the row text if I press ctrl-C.
The row indicator on the left is also showing correctly.
So how do I tell it to not draw the box around the cell?
(it's not a big issue but some user will probably complain about it)
Hello,
I am new to Telerik, in my application we are using RadGridView and load the data dynamically.
when data is large, and I copy pasted from excel then my cells are not highlighted. data is pasted correctly but highlighted cell is not working.
If I edit it manually then it's working fine and I handled this highlighted cell in "CellEditEnd" event.
I walk through multiple forums but none of them are working for me.
I tried to raise ClipboardPaste event but that is not available my RadGridView control.
Also I manually created below function but "MyRadGrid.ChildrenOfType<GridViewRow>()" is not giving me all the index of my radgridview it gives 10 or 15 according to the screen size because of virtualization
private void HighlightUpdateCell(int rowIndex, int columnIndex)
{
int rowNumber = 0;
foreach (GridViewRow gr in MyRadGrid.ChildrenOfType<GridViewRow>())
{
if (rowNumber == rowIndex)
{
gr.Cells[columnIndex].Background = Brushes.Yellow;
break;
}
rowNumber++;
}
}
Another approach was to create a property and set it in style but that is also not working. as cells are not showing in edited mode after pasting data.
I also tried using CellStyleSelector but the is applying changes only on load after that this method is not call itself.
I tried for ClipboardPaste event but unable to find that in my application.
I am using latest Telerik libraries from 2024
Can you please help to highlight the cells of RadGridView after paste is completed.
I have a RadGridView where i've replaced the "Full Text Search" with a custom control (TextBox + Label)
I'm using a Debouncer to collect text changes from the Textbox and then after 300msec - do the search:
if (e.PropertyName == "Query")
{
debounce.Debounce(() =>
{
Dispatcher.Invoke(() =>
{
FilterByQuery();
});
});
}
var searchBytextCommand = RadGridViewCommands.SearchByText as RoutedUICommand;
searchBytextCommand.Execute(Query, radgrid);
Query = String property
radgrid = x:name of the RadGridView.
at some random point in time of the lifetime of the WPF program, this function stops working !
- I dont have any other case of the Debouncer stops working so i trust that it's not the issue.
- WPF Databinding and PropertyChanged events are also working 1000 other places in the program without failing, so i trust that they work too.
- This leads me to believe that the RadGridViewCommands might have an issue..
RiassuntoSorgentiGrid.Columns.Add(new GridViewDataColumn()
{
Header = Utility.LoadString(ResourcesKeys.RipetizioniSorgente),
ColumnGroupName = GENERALGROUPNAME,
DataFormatString = "D",
DataMemberBinding = new Binding("Sorgente.Ripetizioni")
{
Mode = BindingMode.OneWay
}
});
RiassuntoSorgentiGrid.Columns.Add(new GridViewDataColumn()
{
Header = Utility.LoadString(ResourcesKeys.RipetizioniSorgente),
ColumnGroupName = GENERALGROUPNAME,
DataFormatString = "D",
DataMemberBinding = new Binding($"Sorgente.LivelliSingoli[{parametro.Id}][{l}]")
{
Mode = BindingMode.OneWay
}
});
Hi Iam trying to set row numbers in radgrdview as like below.
Please let me know is there any way to do like below.
Regards,
Prabhakar k.