Hi!
I love u guys, i try and try...and learn and learn
but the more i learn, i discover that i dont know nothing...
HEheheh
First let me explain what am trying to do:
I have an RadGridView that have 6 columns
(Name,un,coef,cons,cust,Total).
and
I have an RadNumericTextBox out the grid.
I need that the column 'cons' have an label.text = (the out RadNumericTextBox value) * (the value of the specific
column 'coef')
and
I need that the column 'cust'(that have an RadNumericTextBox ) when changed the specif column 'Total' will be set to
'cons * cust'
and
When the Column 'Total' Blur, the column 'Cust' will be set to 'Total / Cons'
and in the footer i have an another RadNumericTextBox that have the sum of the column 'Total'
The image will explain better what i'm trying to do:
[URL=http://img507.imageshack.us/my.php?image=learnxp1.png][IMG]http://img507.imageshack.us/img507/415/learnxp1.th.png[/IMG][/URL]
http://img507.imageshack.us/my.php?image=learnxp1.png
now for the questions :P:
1)How to make to the column 'cons' modify in the client when the out RadNumericTextBox changed?
2)How to get the value of the column 'Cons' when the RadNumericTextBox of the column 'Cust' changed?
Thanks,
6 Answers, 1 is accepted
Please check this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Controls/Examples/Integration/GridAndInput/DefaultCS.aspx?product=grid
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can also try out the following code snippet.
ASPX:
<Columns> |
<telerik:GridBoundColumn DataField="Col1" UniqueName="Col1" HeaderText="Col1"> |
</telerik:GridBoundColumn> |
<telerik:GridTemplateColumn HeaderText="TempCol" UniqueName="TempCol"> |
<ItemTemplate> |
<asp:Label runat="server" ID="Label1" Text='<%#Eval("TempCol") %>' > |
</asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged" AutoPostBack="True"></asp:TextBox> |
CS:
protected void TextBox1_TextChanged(object sender, EventArgs e) |
{ |
foreach (GridDataItem item in RadGrid1.MasterTableView.Items) |
{ |
int Value1 = int.Parse(item["Col1"].Text); |
int Value2 = int.Parse(TextBox1.Text); |
int Product = Value1 * Value2; |
string strProduct = Convert.ToString(Product); |
Label lbl = (Label)item["TempCol"].FindControl("Label1"); |
lbl.Text = strProduct; |
} |
} |
Thanks
Princy.
but i still need one more thing....that is the out radnumeric when blur need whitout an postback set for each cons label to coef * radnumeric...
if u have the logic for do this...please :P
tks,
JS
var
Grid = null;
function
LoadMasterTable(sender, args)
{
Grid = sender;
}
source grid
<ClientSettings>
<ClientEvents onmastertableviewcreated="LoadMasterTable" />
</ClientSettings>
but when i try to take the specific row, for example i try to pick the first row with:
Grid.get_masterTableView().get_dataItems()[0] ---- this is an object but
Grid.get_masterTableView().get_dataItems()[0].getDataKeyValue(0)--- this is null
why?can anyone help?
tks :P
Please check this example for more info:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Client/Keys/DefaultCS.aspx
Regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center