Select only one radio button in a row with telerik radgrid - wpf

I have 2 radio button columns in telerik radgridview, I want to have selected only one radio button in a row How to do this ?

As user1834059 said, use the GroupName property. The GroupName should be unique for each row, so use your DataKey or any other dataItem value that would be unique for each row (some id).
<telerik:RadGrid ID="RadGrid1" runat="server" >
<MasterTableView
DataKeyNames="myDataKey">
<Columns>
...Your columns...
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:RadioButton ID="radioButton1" runat="server"
Text="Your text"
GroupName='{Binding myDataKey}' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn>
<ItemTemplate>
<asp:RadioButton ID="radioButton2" runat="server"
Text="Your text"
GroupName='{Binding myDataKey}' />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>

Related

ExtJs4 - Form defined in javascript multicombo loaded at runtime

When the form is initially loaded the multicombo on the form correctly reflects the data that is set up.
However, if I attempt to update the information at runtime, the list of options in the multicombo aren't updated when the form is displayed.
I have them successfully defined as form options, they have a simple 'text' only store. However, I can't seem to find the correct set of properties and method to actually update the multicombo from the C# code as needed.
I've noticed this as well. You can set the Ext.net.ListItems on page-load but they are fickle when it comes to setting them dynamically in code-behind. I now always use a Ext.net.Store with any Multicombo or ComboBox that needs to dynamically change.
You can use the Handler events on Focus or BeforeSelect to reload the list.
<ext:ComboBox ID="ComboBoxTransferGroupMembers" runat="server" FieldLabel="Transfer To" EmptyText="Group Members" LabelAlign="Top" DisplayField="Name" ValueField="Id" MarginSpec="0 0 5">
<Listeners>
<Focus Handler="#{ComboBoxTransferGroupMembers}.store.reload()" />
</Listeners>
<Store>
<ext:Store runat="server" OnReadData="StoreTransferGroupMember_ReadData" ID="StoreXferGroup">
<Model>
<ext:Model IDProperty="Id" runat="server">
<Fields>
<ext:ModelField Name="Name" />
<ext:ModelField Name="Id" />
</Fields>
</ext:Model>
</Model>
<Parameters>
<ext:StoreParameter Mode="Raw" Name="Group" Value="#{ComboBoxTransferGroup}.getValue()" />
</Parameters>
</ext:Store>
</Store>
<DirectEvents>
<Select OnEvent="ComboBoxTransferGroupMembers_Select">
<ExtraParams>
<ext:Parameter Mode="Raw" Name="Group" Value="#{ComboBoxTransferGroup}.getValue()" />
</ExtraParams>
</Select>
</DirectEvents>
</ext:ComboBox>

pass the column value when checkbox is clicked in wijmogrid column

i am trying to pass on the column value to the function when the particular column is clicked using ng-click of angular in wijmo grid column.I am getting undefined as value. How do we pass on the associated column value/row value when the checkbox is selected for each row.
my code:
HTML
<wj-flex-grid items-source="instances">
<wj-flex-grid-column header="Select" >
<input type="checkbox" binding = "machinename" ng-click= "model.funcall(args)"/>
</wj-flex-grid-column>
<wj-flex-grid-column header="Application" binding="appname" ></wj-flex-grid-column>
<wj-flex-grid-column header="Server" binding="machine"></wj-flex-grid-column>
<wj-flex-grid-column header="Instance" binding="instancename"></wj-flex-grid-column>
<wj-flex-grid-column header="Last Updated" binding="lastupdated"></wj-flex-grid-column>
<wj-flex-grid-column header="Status" binding="state"></wj-flex-grid-column>
<wj-flex-grid-column header="Error" binding="error"></wj-flex-grid-column>
</wj-flex-grid>
JS
$scope.model.funcall = function funcall(args){
console.log("function called");
console.log(args);
}
You should replace args with $item in order to get the dataItem of that particular row. Here is the code:
input type="checkbox" binding = "machinename" ng-click= "model.funcall($item)"/>
For more details on $item, you can refer to the following doc link:
http://wijmo.com/5/docs/topic/wijmo.angular.WjFlexGridCellTemplate.Class.html

checkbox selection issue in data table

I am using primeface 3.5 where I have datatable with check box column.Among different columns i have a column with amount and when i check any row then i have to calculate 15% of that amount and show the result in another column .My data table is like this:
<p:dataTable id="tblExamPaymentSlip" style="width:1200px;"
value="#{examPaymentSlipMB.paymentSlipList}"
selection="#{examPaymentSlipMB.tempList}"
rowIndexVar="rowsn" var="paymentSlip" rowKey="#{paymentSlip.paymentSlipId}" >
<p:ajax event="rowSelectCheckbox" listener="#{examPaymentSlipMB.addAmt}" process="tblExamPaymentSlip" update="dedId" />
<p:column>
<f:facet name="header">
<h:outputText value="Payment" />
</f:facet>
<h:outputText value="#{paymentSlip.offPaymentMasterModel.paymentAmount}" />
</p:column>
<p:column selectionMode="multiple" headerText="Tax"></p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Deduction" />
</f:facet>
<f:facet name="output">
<p:inputText id="dedId" value="#{paymentSlip.deductionAmt}" />
</f:facet>
</p:column>
</p:dataTable>
Problem is that deduction amount is set in the model class but is not displayed in data table.My managed bean code is like this.
Managed bean:
public void addAmt(SelectEvent event) {
ExamPaymentSlipModel obj =(ExamOfficialModel)event.getObject();
for (ExamPaymentSlipModel examPaymentSlipModel : tempList) {
if (obj.equals(examPaymentSlipModel)) {
examPaymentSlipModel.setDeductionAmount((15*examPaymentSlipModel.getOffPaymentMasterModel().getPaymentAmount())/100);
}
}
}
How can i display the amount ? Can any one help with this.

How to set value of dynamic textInputs of dynamic created table in ADF?

I created dynamic table and also created dynamic textInputs:
XML Below:
<af:forEach items="#{myRowController.myList}" var = "myItem">
<af:column headerText="#{myItem}" width="104" attributeChangeListener="#{test.column_attributeChangeListener}">
<af:inputText value="" id="tt01"/>
</af:column>
</af:forEach>
</af:table>
Problem is:
Created inputTexts have same id and I entered value doesn't set table inputText's
I want to enter values into table and submit all values into table.
<af:table value="#{viewScope.ScheduleActivityBean.rows}"
autoHeightRows="0" varStatus="rwst" var="row" rendered="true"
id="t1" width="100%">
<af:forEach items="#{viewScope.ScheduleActivityBean.columnNames}"
varStatus="colIndex" var="name">
<af:column align="left" headerText="#{name}" width="250px" id="col1"
rendered="#{colIndex.index eq 0}">
<af:inputText id="i7" readOnly="true"
contentStyle="width:170px;font-weight:bold;color:rgb(49,49,49);"
value="#{row.activity}"/>
<af:column align="center" headerText="#{name}" width="120px"
id="co1_${rwst.index}" >
<af:inputText id="it27" readOnly="true"
value="#{row.scheduleName}"
/>
Table data is fetched from viewScope.ScheduleActivityBean.rows
Column names are retrieved from viewScope.ScheduleActivityBean.columnNames
input text values has references as row.scheduleName and row.activity where is row is an element or object of ScheduleActivityBean.rows arraylist(table data).
You can write similar logic for your requirement .

ExtJs Set Parameters Values

I have a form with some controls (extJs and ASP) like this:
<ext:ComboBox ID="Countries" runat="server" .../>
<asp:CheckBox ID="cb1" runat="server" />
I want to send parameters using BaseParams of the store object:
<ext:Parameter Name="cid" Value="Ext.get('#{Countries}').getValue()" />
<ext:Parameter Name="cbv" Value="#{cb1}.dom.checked" />
and that became:
Ext.apply( options.params,{
"cid":Ext.get('CountryCities1_Countries').getValue(),
"cbv":Ext.get("CountryCities1_cb1").dom.checked}
);
as you see get the value from ASP.Net checkbox is simpler than extJs Combobox... Do you know other clean way to get the combobox value?
I found it... Just like this:
<ext:ComboBox ...>
<Listeners>
<Select Handler=" #{myStore}.reload({ params: {cid: this.value}});" />
</Listeners>
</ext:ComboBox>

Resources