iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello
I have a Gridview control using a template -
<intersoft:UXHyperlinkButton Content="{Binding Subject}" Command="{Binding SubjectCommand}" />
<intersoft:UXButton Width="40" DisplayMode="Content" Content="Search by Keyword" Command="{Binding ToggleTopButtonsCommand}" CommandParameter="Keyword" />
I have tried two approaches (hyperlink and button) within the template but the click event does not work with either of them - can you please advise.
Thanks
Hello Richard,
We are sorry for the late response. Regarding your issue, you mean the binding does not work? May I take a look how you do your binding in your case?
Regards,Handy
I add UXButton as UXGridView’s CellTemplateSelector, such as shown in UXGridView Cell Template Selector sample. The sample shows how to use a different template for the UnitInStock cell of which value less than 20.
Following snippet code shows how to define UXButton and bind its command.
<DataTemplate x:Key="WarningTemplate"> <StackPanel Orientation="Horizontal" Margin="4,0"> <TextBlock Text="{Binding UnitsOnOrder}" VerticalAlignment="Center" Foreground="Red" /> <Intersoft:UXHyperlinkButton Margin="4,0" Content="Reorder" Height="24" ShowUnderlineOnHover="True" Foreground="#FF1168CE"/> <Intersoft:UXButton Width="40" DisplayMode="Content" Content="Search by Keyword" Command="{Binding DataContext.ToggleTopButtonsCommand,RelativeSource={RelativeSource FindAncestor,AncestorType=Intersoft:UXGridView}}" /> </StackPanel> </DataTemplate>
The code shows how to use FindAncestor mode to bind the Command property of UXButton inside DataTemplate UXGridView. The binding is performed using FindAncestor mode of ClientUI Binding Framework.
Hope this helps.
I created a simple Silverlight project using Intersoft ClientUI MVVM Data Application (WCF RIA) project template. Products.xaml page is modified to show Products using UXGridView. The UXGridView uses a different template for the UnitsOnOrder cell of which value is zero.
The template uses TextBlock and UXButton. In this sample, the ToggleTopButtonsCommand is defined in the ViewModel. When user clicks the button, a message box will appear.
I uploaded the sample in here. Please kindly have the sample evaluated on your end and let us know whether this helps or not.
If the reported problem still persist, could you please inform us the version of ClientUI that you use so? Thank you and have a nice day.
Thanks Yudi. I have downloaded and see you example working. I have added into my code and soem work and some doesn't. Just to clarify my requirement - in a grideview I wany a cell (column) to show a hyperlink (insead of a text field) - the use can click the hyperlink, go into MVVM code and then what I intended to do is filter the grid based on the value of that cell
For exampe the grid show some records returned - one of the columns is a subject field e.g.Football, Cricket, Tennis. The user can then click that column saying say Tennis and I will go into MVVM code and return a new query based on records with a subject of Tennis.
I have added some of your code and the code does go through the CellTemplateSelector code and appears to return the template, however notyhing happens when I click the column.
I have attached my code - the gridview uses a intersoft:UXGridView.RowTemplateso this may be making it not work.
I have attached some code - relevant part are marked
// MORE CODE HERE ===================================================================================================================
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname