Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
1.5K+ views
I'm trying to capture the ItemDataBound event to conditionally alter the contents of a GridTemplateColumn. The problem is the code example I found assumes you are altering a standard GridBoundColumn. I actually have two databound fields in my GridTemplateColumn and I don't see a way to update their values. 

Here is my code:
        protected void RadGridSummary_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.AlternatingItem | e.Item.ItemType == GridItemType.Item)
            {
               
                GridDataItem gridItem = (GridDataItem)e.Item;
                if (String.IsNullOrEmpty(gridItem["ReferrerName"].Text) == true)           
                {
                    gridItem["ReferrerName"].Text = "(None)";
                
            }
        }

I can only reference the name of the GridTemplateField "Referrer" and I don't know how to access the 2 data bound columns using the object model. Here is my ASPX code:

<telerik:GridTemplateColumn UniqueName="Referrer"                     SortExpression="ReferrerName" HeaderText="Referrer / Keyword">
                    <HeaderStyle Width="150px"></HeaderStyle>
                    <ItemStyle Height="35px"></ItemStyle>
                    <ItemTemplate>
                        <span class="gridItemText">
                            <%# DataBinder.Eval(Container.DataItem, "ReferrerName") %>
                        </span>
                        <br />
                        <span class="gridItemTextAlt">
                            <%# DataBinder.Eval(Container.DataItem, "Keyword") %>
                        </span>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

I want be able to capture the event of the ReffererName field being handled so I can alter its value. I saw another example that showed updating a checkbox in another field by using it's control collection, but I did not see how this could be applied to the GridTemplateColumn. Here is the original article I found which shows how to update a regular field:
http://www.telerik.com/help/aspnet/grid/radgrid-telerik.webcontrols.radgrid-itemdatabound_ev.html


Any help would be greatly appreciated!

Thanks,
Levi
Mahdy
Top achievements
Rank 1
 answered on 28 Mar 2013
1 answer
49 views

Dear sir ,
Radlist view edit template example on Telerik database on customerphotos table shows the following fields

Name:
Title:
City:
Country:
Phone:


my question is how do I add the address field( in design time) to be shown and edited ,updated or even inserted in the Radlistview templates

note that I show and update the photo too

============================
what i did is reconfiguring the sqldatasource and added the field address from customerphotos
then i added in design time in edititemtemplate a binded textbox to that field but when i press update after writing in the address field and selecting an image ,I got the following error

Parameter '@Photo' exceeds the size limit for the sql_variant datatype.

Andrey
Telerik team
 answered on 28 Mar 2013
0 answers
132 views
Hi all

There are tow questions regards this requirement:

1- I am trying to open a user control in edit form mod , in user controls i have used footable  (reference Link themergency.com/footable/) with asp gridview. footable functionality not working with in user control, if I simply open  that control at another page other than in line edit form user control in radgrid footable workng correctly , is there any conflict between telerik and other jquery plugins ...?

2 - I want to make Telerik radgrid as behave as footable  (refrence Link http://themergency.com/footable-demo/demo.htm) please help if possible


Thanks
Saquib
Top achievements
Rank 1
 asked on 28 Mar 2013
1 answer
108 views
The text for the radButton is overlapping the radio button.  Any suggestions?
Princy
Top achievements
Rank 2
 answered on 28 Mar 2013
1 answer
74 views
In RadTreeList inside the tree list
<telerik:TreeListTemplateColumn HeaderText="Cur. Cumulative Claim " HeaderStyle-Width="100px"
                             DataField="EntQnty" UniqueName="EnterQuantity">
                             <ItemTemplate>
                                 <telerik:RadNumericTextBox MaxLength="5" ID="EntQntyId" Width="80px" runat="server"
                                     Text='<%# Bind("EntQnty") %>' onkeydown="return (event.keyCode!=13);" AutoPostBack="true"
                                     FocusedStyle-BackColor="Yellow" AutoCompleteType="Disabled" OnTextChanged="EntQntyId_TextChanged">
                                 </telerik:RadNumericTextBox>
                                 <asp:HiddenField ID="HdnEqnty" runat="server" Value='<%# Bind("PrevCert") %>' />
                                 <asp:HiddenField ID="HdnQuantity" runat="server" Value='<%# Bind("Quantity") %>' />
                             </ItemTemplate>
                         </telerik:TreeListTemplateColumn>
If i enter the radnumerictext box i fire textchanged event that's fire but focus got out . how i set the focus in same text box.
See the attachment .

Thanks Advance,
Mohamed.
Princy
Top achievements
Rank 2
 answered on 28 Mar 2013
1 answer
55 views
I am working on an asp.net web application that uses the 2008 Telerik asp.net ajax library. If I buy the new telerik asp.net ajax library, do I have to update existing code? 
Princy
Top achievements
Rank 2
 answered on 28 Mar 2013
0 answers
90 views
I use 3 control's to update a hierarchy radgrid view
control 1 changed the select column ,like this,
dropdownlist  a,  item 1    :      select   workhour  as p1  from table1
dropdownlist  a , item 2    :       select  workhour*salary as p1  from table1

control 2 and 3  do not  change the  select column
all of the 3 control are in  ajaxmanager , like this....
all of the 3 control autopostback is true ,  and called  RadGrid1.MasterTableView.Rebind()  method;
~~~~~~~~~~~~~
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="rbl1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="rbl1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="cbl1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="cbl1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>


~~~~~

the problem is :  if I don't  use  aggregate column to sum  the column,   it works  fine,

if I use aggregate column  to sum the column ,  when I change control 1 ,  It will report an error   at   Rebind() method.

protected void RadGrid1_Rebind(object sender, EventArgs e)
        {
            RadGrid1.MasterTableView.Rebind();
        }

when I change control 2 , 3 , it works fine too....


I cannot find the way .......

(Hope someone can understand what I'm saying)

update:

I found the reason ,
dropdownlist a, item 1 : select workhour as p1 from table1 ,   workhour is   decimal  type
dropdownlist a , item 2 : select cast(workhour*salary as int)  as p1 from table1,  workhour*salary   is  int  type.....


I use Numericrow ,and format it to {0:G0}
it works fine
Fei
Top achievements
Rank 1
 asked on 28 Mar 2013
2 answers
172 views
I've included the RadAsyncUpload control within a table on my page.  When the page is executed and the user mouses over the Select button of the RadAsyncUpload control, the entire control shifts position on the page.  The original alignment can be seen in the attached file "radasyncupload correct spacing.jpg".  The file "radasyncupload after mouseover.jpg" contains a screen print after the user mouses over the Select button.  Notice the entire control shifts up on the page.  Is there something I can add to my CSS to prevent this from happening?  Thanks in advance.
Lynne
Top achievements
Rank 1
 answered on 27 Mar 2013
3 answers
160 views
Have a column in my DataGrid which I have formatted to GridDateTimeColumn and set the filter option to include the Datapicker. 

What I would like to do is use the MonthYearPicker instead. How would I go about this?  Also when passing the filtered date along I want to verify it is the last day of that month, is there a way to do that in the control?
<telerik:GridDateTimeColumn DataField="cycle_date" DataFormatString="{0:d}"
 FilterControlAltText="Filter column13 column" HeaderText="CYCLE DATE"
 MinDate="1993-01-01" UniqueName="cycle_date" DataType="System.DateTime"
 EditDataFormatString="MM/YYYY">
 <HeaderStyle HorizontalAlign="Center" />
 <ItemStyle HorizontalAlign="Right" Width="125px" />
</telerik:GridDateTimeColumn>
Kurt Kluth
Top achievements
Rank 1
 answered on 27 Mar 2013
3 answers
75 views
Hi,

I have a very simpler splitter with a left and right pane.
The left pane is a navigator (treeview) and is intended to be a fixed width, unless the user specifically resizes it.
If the user changes the width of their browser window in Windows (IE, Firefox or Chrome), the left pane remains a fixed size (as desired) and the right pane has its width pro grammatically changed (see Javascript below).
If the user does the same thing on a browser on the MAC (have tried Firefox, Chrome and Safari), the left pane will grow in width as the user drags the browser window to enlarge it.

Note: Ignore the name MiddlePane - it's really the right pane (there used to be three).
Also, dv is a DiagramView (from MindFusion).

Nowhere in my code do I explicitly set the width of the left pane - only the right (middle) one.

Any ideas on what might be causing this?

Thanks in advance.

Jim


var splitter = $find("<%=RadSplitter1.ClientID %>");
                if (splitter != null)
                {
                    var leftpane = splitter.getPaneById('<%= LeftPane.ClientID %>');
                    var midpane = splitter.getPaneById('<%= MiddlePane.ClientID %>');
                    var leftWidth = leftpane.get_width();
                }
                 
                var dv = document.getElementById("<%= DiagramView1.ClientID %>");
                var marginsPlusSpltibar = 35;
 
                if (leftpane != null)
                {
                    //alert("In Resize Main");
                    // The more standards compliant browsers (mozilla/netscape/opera/chrome/IE7) use window.innerWidth and window.innerHeight
                    if (typeof window.innerWidth != 'undefined')
                    {
                        //alert("One");
                        alert("leftWidth = " + leftWidth);
                        var txtBannerHeight = document.getElementById('<%=txtBannerHeight.ClientID%>');
                        var bannerHeight = 0;
                        if (txtBannerHeight != null)
                            bannerHeight = parseInt(txtBannerHeight.value);
 
                        var newHeight = window.innerHeight - 270 + bannerHeight;
                        midpane.set_height(newHeight);
                        leftpane.set_height(newHeight);
                        var newWidth = (window.innerWidth - leftWidth - marginsPlusSpltibar);
                        midpane.set_width(newWidth);
                        splitter.set_height(newHeight);
                        splitter.set_width(window.innerWidth);
                        if (dv != null)
                        {
                            dv.style.height = (newHeight - 24) + "px";
                            dv.style.width = (newWidth - 5) + "px";
                        }
 
                    }
Vessy
Telerik team
 answered on 27 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?