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

I've customized a RadGrid so that my Category field can be selected from a dropdownlist.

I've done this via the following code in the 'EditItem' template for my ProductCategoryName Template column
As shown below
<telerik:GridTemplateColumn DataField="ProductCategoryName"
            DefaultInsertValue="" HeaderText="Category"
            SortExpression="ProductCategoryName" UniqueName="ProductCategoryName">
            <EditItemTemplate>          
                    
           <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSourceCategories" DataTextField="CategoryName" DataValueField="CategoryName" SelectedValue='<%# Bind("ProductCategoryName") %>'>
           </asp:DropDownList>        
                    
                    
            </EditItemTemplate>


My problem is that it appears that the RadGRid does not have an <InsertItemTemplate> and instead just uses whetever is in the
<EditItem> Template when one is in in Insert mode.

This, naturally means that I get the following error...

'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value


Would anyone be able to provide me with a solution for this problem ?


Radoslav
Telerik team
 answered on 21 Jul 2010
1 answer
143 views
Hello,

I have a button at my pager template in GRID with text = "Approve", on page load i want text change on button clicking, means if text = "approve" is clicked then text should change to  = "raject" and if text = "reject" is clciked, the  text must  = "approve"

.......

 

<PagerTemplate>

 

 

<table>

 

 

<tr>

 

 

<td>

 

 

<asp:Button ID="btn1" runat="server" Text="Approve" />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

 

</PagerTemplate>

 


 

</telerik:RadGrid>

I m trying to do below manner, but won't able to capture button click event, please help

 

 

 

 

protected

 

void grdADInbox_ItemCreated(object sender, GridItemEventArgs e)

 

{

 

if (e.Item is GridPagerItem)

 

{

 

GridPagerItem item = (GridPagerItem) e.Item;

 

 

Button btn = item.FindControl("btnFutureApprovals") as Button;

 

 

switch (btnFutureApprovals.Text)

 

{

 

case "Future Approvals":

 

btnFutureApprovals.Text =

"Current Approvals";

 

 

break;

 

 

case "Current Approvals":

 

btnFutureApprovals.Text =

"Future Approvals";

 

 

break;

 

}

}

}

Princy
Top achievements
Rank 2
 answered on 21 Jul 2010
1 answer
108 views
hi
im looking how i can localize my radupload in italian?

thanks
regards

webster
Shinu
Top achievements
Rank 2
 answered on 21 Jul 2010
3 answers
87 views
Hi,

Apologises for my previous post - codesnippet formatting didn't work.

Well, I am looking for a solution where by I can have a Radtree with nodes. Each node will have inner node containing checkboxlist. All nodes and checkboxlist get populated from database. It can be done in designtime with NodeTemplate. I am sure it is possible in runtime as well but I am not sure how can I add NodeTemplate in runtime to the inner nodes only. I looked into documentation  NodeTemplate in Runtime but doesn't help a lot.


Could you please kindly hint me how it can be achieved.

Thanks in advance.

Cheers,
M G
Veronica
Telerik team
 answered on 21 Jul 2010
4 answers
369 views

I'm not sure if this is related just to jQuery, or if there is an issue with the Telerik version thereof.

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 

My goal is to capture the Enter key in a textbox, and depending on the textbox which has focus, move to the next appropriate control. When I move from one textbox to another, it's fine. When I want to move from a textbox to a checkbox, I can't get an object for the checkbox, the return value (ctrl) is null.  The following is in a RadCodeBlock.
function KeyPressed(ctrl, e) {  
  if (e.get_domEvent().rawEvent.keyCode == 13) {  
    var ID = ctrl.get_id();  
    var ctrl;  
    if (ID.indexOf("F1") >= 0) ctrl = $find("<%= F2.ClientID %>");      
    if (ID.indexOf("F2") >= 0) ctrl = $("#<%= C1.ClientID %>"); // fail       
    // $find("<%= C1.ClientID %>"); // this didn't work either  
    if (ctrl !== null) {      
      e.set_cancel(true);      
      setTimeout(function() { ctrl.focus(); }, 1);      
    }  
    ...  
  }  
}

The F1 and F2 controls are textboxes. C1 is a checkbox (all control names simplified for this text).  The controls look like this:
<telerik:RadNumericTextBox ID="F1" Width="80px" runat="server" 
  Type="Number" NumberFormat-DecimalDigits="0" ClientEvents-OnKeyPress="KeyPressed" /> 
...  
<telerik:RadNumericTextBox ID="F2" Width="80px" runat="server" 
  Type="Number" NumberFormat-DecimalDigits="0" ClientEvents-OnKeyPress="KeyPressed" /> 
...  
<asp:CheckBox ID="C1" runat="server" Text="Check Me!" /> 

I'd like to understand what's wrong, but since we're here, outside of this kind of manual wiring, is there any more elegant way to set the Enter key to follow TabStops?

Thanks!
Sebastian
Telerik team
 answered on 21 Jul 2010
2 answers
187 views
I've looked at the demos and did not see one that shows this - so, is it possible to have a dock that collapses from right to left?
Im trying to create something that would have two panels, side by side. The left one (Panel1) would be an informational panel that the user could pin or collapse and when collapsed the other panel (Panel2) would fill the browser window.
adnan
Top achievements
Rank 1
 answered on 21 Jul 2010
2 answers
83 views
It seems that ToString() is called for every object in datasource with no reason. My problem is that the function is overrided and is time consuming (bad writed).

After some research, i see the line in GridBoundColumn.cs in method OnDataBindColumn
            if (item1.DataItem != null && item1.DataItem.ToString() == "Microsoft.SharePoint.WebControls.SPDataSourceViewResultItem")

I do not known why it is necessary, why not item1.GetType().FullName ?
Tsvetoslav
Telerik team
 answered on 21 Jul 2010
3 answers
1.1K+ views
Hello i am using  Rad grid ..my code is the following
 <Columns>
        <telerik:GridBoundColumn DataField="imgTitle" HeaderText="imgTitle"
            SortExpression="imgTitle" UniqueName="imgTitle">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="imgID" DataType="System.Int32"
            HeaderText="imgID" ReadOnly="True" SortExpression="imgID" UniqueName="imgID">
        </telerik:GridBoundColumn>
          <telerik:GridTemplateColumn DataField="Image" HeaderText="Image"
            SortExpression="Image" UniqueName="Image">
              <ItemTemplate>
                 
                    <img src='<%# Eval("imgFile") %>' id="image1" width="30px" height="50px" />
               
                    
               
                </ItemTemplate>
           
        </telerik:GridTemplateColumn>
    </Columns>



I need to insert Tooltip for each cell in column image to show this text in tooltip " view album"
please help
sam
Top achievements
Rank 1
 answered on 21 Jul 2010
3 answers
231 views
Hello,

Can somebody tell me how do I access an image (html control) inside the TabTemplate from the Server Side?

Thanks
Yana
Telerik team
 answered on 21 Jul 2010
1 answer
149 views
Hi all, I am getting  Only the first record is tooltipified
I  am using radgrid and i have a bound image column  and my code is the following

<telerik:GridTemplateColumn DataField="Image" HeaderText="Image"
            SortExpression="Image" UniqueName="Image">
              <ItemTemplate>
                 
                    <img src='<%# Eval("imgFile") %>' id="image1" width="30px" height="50px" />
                 
                 
                </ItemTemplate>
           
        </telerik:GridTemplateColumn>

I want to Use Radtooltip  or RadTooltipManager  instead of the traditional tooltip
I tried to use Radtooltip first error i get is :

Cannot find a server control with ID=image1. If you need to specify a client-side element ID, please set IsClientID to true.

 I changed IsClientId properties to true

my code is now like this

<ItemTemplate>
                 
                    <img src='<%# Eval("imgFile") %>' id="image1" width="30px" height="50px" />
                  <telerik:RadToolTip ID="RadToolTip2" runat="server" Animation="Slide" TargetControlID="image1" IsClientID="True" >
                   <%#Eval("IMGFILE", "SHOW ALBUM")%>
                
                 </telerik:RadToolTip>

</ItemTemplate>


 Only the first record is tooltipified

please help me and thanks in advance



sam
Top achievements
Rank 1
 answered on 21 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?