Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
227 views
Hi,

How to dynamically bind data to a drop down list in a RAD grid control.

i tried using the following lines, but the event is not firing! 

protected void grd_ItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e) 
ddl.DataBinding += new EventHandler(ddl_DataBinding); 

        void ddl_DataBinding(object sender, EventArgs e) 
        { 
            try 
            { 
                DropDownList ddl = (DropDownList)sender; 
                possibleTargetOutcome = RetrieveData(); 
 
                ddl.DataSource = possibleTargetOutcome; 
                ddl.DataTextField = "DisplayText"
                ddl.DataValueField = "InputValue"
                ddl.DataBind(); 
            } 
            catch(Exception ex) 
            { 
                lblErrorMessage.Text = ex.Message; 
            } 
        } 

Anyone have solution for this?

Thanks
Viswa
Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
6 answers
195 views
hi
when i add dynamic user control in contentplaceholder and set in masterpage RadAjaxManager then script in that user control do't work
please help me :(( :((

my test project
hesam
Top achievements
Rank 1
 answered on 29 Jul 2009
3 answers
917 views
Hello All,


i  need access rad grid template columns ( there is mumeric text boxes in columns ) and i need access this controls from javascript runtime ?

Example :


my grid :


 

<telerik:RadGrid ID="GridBudget" runat="server" GridLines="None" Skin="Default" AllowCustomPaging="True"

 

 

ShowHeader="true" ShowFooter="true" AutoGenerateColumns="False" Width="100%"

 

 

OnItemDataBound="GridBudget_ItemDataBound">

 

 

<PagerStyle NextPageText="&amp;gt;" PrevPageText="&amp;lt;" />

 

 

<MasterTableView AllowCustomSorting="true" NoMasterRecordsText="Listelenecek rn bulunamad."

 

 

GroupLoadMode="Client" CellSpacing="-1">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="cID" HeaderText="ID" SortExpression="BUDGET.ID"

 

 

Display="false" HeaderStyle-HorizontalAlign="Center" UniqueName="BUDGET.ID" DataType="System.Int32"

 

 

Visible="false">

 

 

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="BUDGET_NAME" HeaderText="BšT€E ADI" SortExpression="BUDGET.NAME"

 

 

HeaderStyle-HorizontalAlign="Center" UniqueName="BUDGET.NAME" DataType="System.String">

 

 

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn HeaderText="TOTAL" HeaderStyle-HorizontalAlign="Center"

 

 

UniqueName="EnterBudgetTemplate">

 

 

<ItemTemplate>

 

 

<telerik:RadNumericTextBox ID="txtTotal" runat="server" Culture="Turkish (Turkey)"

 

 

InvalidStyleDuration="100" MinValue="0" Type="Currency" Value="0" Width="100px">

 

 

<NumberFormat NegativePattern="-n" PositivePattern="n" />

 

 

<ClientEvents OnValueChanged="GridNumericChanged" />

 

 

</telerik:RadNumericTextBox>

 

 

</ItemTemplate>

 

 

 

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="JANUARY HeaderStyle-HorizontalAlign="Center"

 

 

DataField="MONTH1" UniqueName="M1_TEMPLATE">

 

 

<ItemTemplate>

 

 

<telerik:RadNumericTextBox ID="txtM1" runat="server" Culture="Turkish (Turkey)" InvalidStyleDuration="100"

 

 

MinValue="0" Type="Currency" Value="0" Width="75px">

 

 

<NumberFormat NegativePattern="-n" PositivePattern="n" />

 

 

</telerik:RadNumericTextBox>

 

 

</ItemTemplate>

 

 

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="FEBRUARY" HeaderStyle-HorizontalAlign="Center"

.
.
.

and i have 12 months like these in columns.

and when user write a value in 'txtTotal' textboxes . i need to calculate a value per month and set them via javascript


function GridNumericChanged()

{
    

 

 

var grid = $find("<%=GridBudget.ClientID %>");

 

 

var MasterTable = grid.get_masterTableView();

 

 

var Rows = MasterTable.get_dataItems();

 

 

 

for (var i = 0; i < Rows.length; i++)

 

{

 

var row = Rows[i];

 

 

...??

}

can anybody help me for reach template column and cells from client side.

thank you.

 

Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
4 answers
97 views
I am using the following from the percent example to change graph from counts to percent:

 

'renders as percent or count depending on choice in 1stSelectType
Dim s As ChartSeries = trcRadChart.Series.GetSeries(intInnerLoopCount)
Select Case lstSelectFormat.SelectedIndex
 Case 0
    s.DefaultLabelValue = "#%"
     Exit Select
Case 1
    s.DefaultLabelValue = "#Y"
    Exit Select
End Select

My user want the percent calculated based upon the grouping on the xaxis - is there an easy way to do this?.

 

 

Vladimir Milev
Telerik team
 answered on 29 Jul 2009
2 answers
295 views
Hi,

I am using radlistbox and I want to perform some operations on listbox client side SelectedIndexChanged event and below is my code.

 

<script language="javascript" type="text/javascript">

 

 

function onSelectedIndexChanged(sender, args)

 

{

alert(

"Selected index changed");

 

}

 

</script>

 



 

<table cellpadding="2" cellspacing="2" border="0" class="TableBorder" width="100%">

 

 

<tr valign="top">

 

 

<td style="width: 105px">

 

 

&nbsp;</td>

 

 

<td class="clsLabel">

 

 

<asp:Label id="lblExisting" runat="server" text="<%$ Resources:pageLabels, lblExistingPlans %>" CssClass="clsLabel"></asp:Label>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td>

 

 

<telerik:RadListBox ID="lstExistingPlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" OnClientSelectedIndexChanged="onSelectedIndexChanged()"></telerik:RadListBox>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td class="clsLabel">

 

 

<asp:Label id="lblAvailable" runat="server" text="<%$ Resources:pageLabels, lblAvailablePlans %>" CssClass="clsLabel"></asp:Label>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

<tr valign="top">

 

 

<td style="width: 105px">&nbsp;</td>

 

 

<td>

 

 

<telerik:RadListBox ID="lstAvailablePlans" runat="server" Width="763px" Height="250px" CssClass="clsLable" Skin="Office2007" AutoPostBack="true"></telerik:RadListBox>

 

 

</td>

 

 

<td style="width: 100px">&nbsp;</td>

 

 

</tr>

 

 

</table>

Now the problem is this client side event fires on each postback but when I click on the listbox on which i have written the client side event its not working instead its throwing a javascript error as.

"Error: a[b] is not a function
Source File: http://localhost/Kam.Web/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ContentPlaceHolder1_ScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d1.0.61025.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1f0f78f9-0731-4ae9-b308-56936732ccb8%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.701.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3affafc724-e959-4dca-aca2-eeb92fdb8ca6%3a16e4e7cd%3a874f8ea2%3af7645509%3a24ee1bba%3a19620875%3a33108d14%3abd8f85e4%3ae330518b%3a1e771326%3ac8618e41%3aaa288e2d%3a58366029%3ab7778d6c%3ae085fe68%3a8674cba1%3ac08e9f8a%3aa51ee93e%3a59462f1%3a2bef5fcc%3bAjaxControlToolkit%2c+Version%3d1.0.10301.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a9b0dcc70-5e43-4d30-b6d6-3ed8d0eb217f%3ab14bb7d5%3a755018fe%3a13f47f54%3a35ff259d%3ab80820f8
Line: 6"

Kindly advise.

Regards,

Santhosh

 

santhosh
Top achievements
Rank 2
 answered on 29 Jul 2009
2 answers
118 views
I am using a radgrid in my projet  When i click "Add new Record" button automaticly a new row creating . 2 colums has radnumerictextbox
and i want to make "0"  value of other radnumerictextbox  wheen i enter some value one of radnumerictextbox .

I accomplish it when i update a record  but i didnt do it when i insert a new recor ....
                        function onCommand(sender, args) 
                        {                                         
                                 if(args.get_commandName()== 'Edit')  
                                 {     
                                   currentRowIndex = args.get_commandArgument();  
                                   
                                 } 
                                                
                        }          
                                   
                        function onKeyPresstbBorc(sender, eventArgs) 
                        { 
                          alert(currentRowIndex); 
                          var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();  
                          var dataItem = masterTable.get_dataItems()[currentRowIndex]; 
                          var radTextBox1 = dataItem.findControl("tbAlacak"); 
                          radTextBox1.set_value(0.00); 
                        } 


 when i want to edit a record i use the above code and it work . but i dont know how can i do when i new record inserting  ????




 
fatih ak
Top achievements
Rank 1
 answered on 29 Jul 2009
1 answer
38 views
Hi everybody.
I want to know if it is possible to show the scheduler from a specific time slot.
The thing is, I always show the 24 hours at the diary view, but I want to show it from the first appointment of the day. For example, if I have an appointment at 8:00 am, I want that the scheduler shows from that time but that the user could scroll to see all the day..

thanks

Fernando
T. Tsonev
Telerik team
 answered on 29 Jul 2009
5 answers
580 views
I can't get RadToolTip or RadToolTipManager to display tooltips for radcontrols!
I have a normal button and the tooltip and tooltipmanager show the tooltips perfectly for it, as soon as I turn them to point a the radtextbox or the radcombobox, I just get an empty tooltip.  If I set the tooltip message in the controls tooltip, I get the empty RadToolTip under the controls default tooltip message.  What am I missing? 
Svetlina Anati
Telerik team
 answered on 29 Jul 2009
1 answer
127 views
Hi,

Is there a way to easily convert a RecurrenceRule to an EWS RecurrenceType ?

Thanks
T. Tsonev
Telerik team
 answered on 29 Jul 2009
0 answers
56 views
Hi,
 i am tried to read all the nodes on button click event. But when i expand all the nodes in a tree and click button , i am
able to read all the nodes which have expanded. But i cant read the vales with  out expanding any of the values.

Here is my code...http:///
protected void btnBnext_Click(object sender, EventArgs e) 
    { 
        RadTreeView1.ExpandAllNodes(); 
         
        foreach (RadTreeNode NodeToExpand in RadTreeView1.GetAllNodes()) 
        { 
             
            //# region Fields 
            //StringBuilder strBldr = new StringBuilder(); 
            //# endregion 
            //strBldr.Append("<root>"); 
            //strBldr.Append("</root>"); 
        } 
     
       
    } 
Plz help me!!

Regards!
chithuraj.j
chithuraj
Top achievements
Rank 1
 asked on 29 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?