Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
101 views
Hi;

The Question i want to ask is very simple..How can i create Handle of dynamically created docks..like in below example we are using javascript to create handle of docks..similarly i want to create handle on server side..like if i place Image in docks from Database then that image should be the handler of that dock..



Regards;

Zeeshan Ahmed Khan


Pero
Telerik team
 answered on 06 Aug 2009
1 answer
115 views
Hi team,

I use radgrid in that the properties that i set true is allowfiltering,allowpaging and allowsorting. i used template column for the edit and the delete. so that when i click the edit button the grid shows the inline editing in the grid even though i set the properties of the automatic updates and delete to false.And  i did not give any editmode in the mastertable. while clicking the edit button in my grid the values will transfer in to the textboxes where the textboxes are placed in the modalopup.and the grid shows the inline editing.

Please help me
Thanks in Advance

Pavlina
Telerik team
 answered on 06 Aug 2009
2 answers
227 views
Hi Telerik team,

I am adding some controls dynamically to a Repeater which is inside a FormView.

protected

 

void DynamicRepeater_ItemCreated(Object sender, RepeaterItemEventArgs e)

 

{

 

IDictionary

 

<string, string> values = RetrieveValues();

 

 

RadComboBox combo= new RadComboBox();

 

//DropDownList combo= new DropDownList();
combo.ID =

"SomeId";

 

combo.DataSource = values;

combo.DataValueField =

"Key";

 

combo.DataTextField =

"Value";

 

e.Item.Controls.Add(combo)

 

}

There is another RadComboBox control  named TypeComboBox with AutoPostBack="true" inside the FormView.
Whenever the TypeComboBox selection changes, the repeater needs to be rebound and the dynamic controls will be recreated inside the repeater.

So I added the following code to ajaxify the repeater:
protected void Page_PreRender(object sender, EventArgs e)

 

{

 

 

 

RadComboBox

 

typeComboBox = (RadComboBox)FormView1.FindControl("TypeComboBox ");

 

 

 

 

RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(typeComboBox , (Repeater)FormView1.FindControl("DynamicRepeater"));

 

 

}

This does not work.The point is when I replace the RadComboBox with an Asp DropDownList  ,the ajax works fine.So I assume the problem might be happening by the RadComboBox.
Note that Ajaxifying the whole FormView is not an option for me, because I don't want to lose the data that user entered in the other controls in the FormView after selecting the Type.

 
I had a previous issue with the ajaxifying other controls like Panel and PlaceHolder inside a FormView(Support ID:228263 -- Problem with RadAjaxManager and Panel or PlaceHolder inside a FormView), but I am afraid the answer was not very saticefying because like I explained the whole FormView shouldn't be refreshed in my case.

What can I do to solve this issue?

Thanks in advance for your help.
Sima

Veselin Vasilev
Telerik team
 answered on 06 Aug 2009
1 answer
118 views
I created this using dynamic RadSplitter creation with recursion:

http://imgur.com/uiWfq

Use the following code to recreate this masterpiece:
(use at own risk)

Imports Telerik.Web.UI 
 
Partial Class _Default 
    Inherits System.Web.UI.Page 
 
    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) 
        MyBase.OnLoad(e) 
 
        F(ph) 
 
    End Sub 
 
    Private Sub F(ByVal pane As Control, Optional ByVal limit As Integer = 10) 
 
        If limit <= 0 Then 
            Dim blah As New Literal() 
            blah.Text = " " 
            pane.Controls.Add(blah) 
            Exit Sub 
        End If 
 
        If TypeOf pane Is WebControl Then 
            Dim rand As New Random(pane.GetHashCode) 
            Dim r As Integer = rand.Next(100, 255) 
            Dim g As Integer = rand.Next(10, 255) 
            Dim b As Integer = rand.Next(50, 255) 
            CType(pane, WebControl).BackColor = System.Drawing.Color.FromArgb(r, g, b) 
        End If 
 
        Dim splitter As New RadSplitter() 
        splitter.Orientation = If(limit Mod 2 = 0, Orientation.Horizontal, Orientation.Vertical) 
        splitter.PanesBorderSize = 0 
 
        Dim leftPanel As New RadPane() 
        leftPanel.Scrolling = SplitterPaneScrolling.None 
        F(leftPanel, limit - 1) 
        splitter.Items.Add(leftPanel) 
 
        Dim rightPanel As New RadPane() 
        rightPanel.Scrolling = SplitterPaneScrolling.None 
        F(rightPanel, limit - 1) 
        splitter.Items.Add(rightPanel) 
 
        Dim spacing As New Panel() 
        spacing.Style.Add("padding", "5px") 
        spacing.Controls.Add(splitter) 
 
        pane.Controls.Add(spacing) 
    End Sub 
 
End Class 
 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
</head> 
<body> 
    <form id="form1" runat="server"> 
     
    <asp:ScriptManager runat="server" /> 
     
    <asp:PlaceHolder runat="server" ID="ph" /> 
     
    </form> 
</body> 
</html> 
 
Mr. Plinko
Top achievements
Rank 1
 answered on 06 Aug 2009
2 answers
195 views
I have a simple grid with template column:

<

 

telerik:GridTemplateColumn HeaderText="Notification" UniqueName="TemplateColumn"

 

 

 

EditFormColumnIndex="1" ReadOnly="false">

 

 

 

<ItemTemplate>

 

 

<%

# Eval("vchNewsText") %>

 

 

 

</ItemTemplate>

 

 

 

 

<EditItemTemplate>

 

 

 

<span><telerik:RadTextBox runat="server" ID="txtNotification" Width="750px" height="200px"

 

 

 

TextMode="MultiLine"

 

 

 

Text='<%# Bind("vchNewsText") %>'></telerik:RadTextBox><span></span>

 

 

 

</EditItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

</Columns>

 

 

 


User is supposed to add a new row and fill in the vchNewsText field.

In Grid_ItemCommand procedure I am  trying to extract new value from txtNotification TextBox in order to update
dataset. 

s1 = (editedItem.FindControl(

"txtNotification") as TextBox).Text;

 

 


Result-control not found 

Another try was:

 

Hashtable newValues = new Hashtable();

 

e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
s1=(string)newValues["TemplateColumn"];

Result-empty string;

So how do I extract the new value of Control in Template Column in Grid_ItemCommand procedure ?

 

 

 

 

 

 

Elena
Top achievements
Rank 1
 answered on 06 Aug 2009
1 answer
130 views
Hi,

I have a simple panel bar with itemtemplates, within the itemtemplate i have a table containing server controls. how would i access the server controls from the server side code? Findcontrol does not seems to work.

<asp:Panel ID="pnlStudentDetails" runat="server" Height="100%" Width="100%">
   
       <telerik:RadPanelBar ID="radPnl" runat="server" Width ="70%" Skin="Sunset" 
       ExpandMode="MultipleExpandedItems">
          
       <Items>
       <telerik:RadPanelItem Text="Name" Expanded ="true" Font-Bold="True" runat="server">
           <Items>
            <telerik:RadPanelItem  runat ="server">
            <ItemTemplate>
               <asp:Table ID="tblName" runat="server">
                   <asp:TableRow id="trRow1" runat ="server" Width ="10%">
                         <asp:TableCell rowspan="3" id="tcImage" runat ="server" CssClass="TableCell" ><asp:Image ID="imgStu" runat ="server"  ImageUrl ="~/Images/logo.gif"  BorderWidth ="1px"/></asp:TableCell>
                         <asp:TableCell id="tcFullName" ColumnSpan ="3" runat ="server" CssClass="TableCell"><asp:Label ID="lblFullName" runat ="server" Text ="FullName" CssClass="labelValueSrc"></asp:Label><asp:ImageButton ID="ImgAudio" runat ="server" ImageAlign="Right"/></asp:TableCell>
                       
                   </asp:TableRow>
                   <asp:TableRow id ="trRow2" runat ="server" CssClass="TableCell">
                        <asp:TableCell id ="tcPrfName" runat ="server" CssClass="TableCell"><asp:Label ID="lblPrfName" runat ="server" Text="Preferred Name" CssClass="labelSrc"></asp:Label></asp:TableCell>
                        <asp:TableCell id="tcPrfNameValue" runat ="server" CssClass="TableCell"><asp:Label ID="lblPrfNameValue" runat="server" CssClass="labelValueSrc"></asp:Label></asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow id="trRow3" runat="server" CssClass="TableCell">
                        <asp:TableCell id="tcNotes" runat ="server" CssClass="TableCell"><asp:Label ID="lblNotes" runat="server" Text ="Notes/Messages" CssClass="labelSrc"></asp:Label></asp:TableCell>
                        <asp:TableCell id="tcNotesValue" runat="server" CssClass="TableCell"><asp:Label ID ="lblNotesValue" runat ="server"  CssClass="labelValueSrc"></asp:Label></asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
            </ItemTemplate>
            </telerik:RadPanelItem>
            </Items>
       </telerik:RadPanelItem>
</telerik:RadPanelItem>
</asp:Panel>

Peter
Telerik team
 answered on 06 Aug 2009
2 answers
238 views

Hello,

I want to disable the RadGrid's ability to highlight and select rows when hovering over a row with the pointer. However, setting the appropriate attribute  EnableRowHoverStyle has no effect, one can still highlight rows and select them.

<ClientSettings EnableRowHoverStyle="False" Selecting-AllowRowSelect="False">  
    <Selecting AllowRowSelect="false" EnableDragToSelectRows="False" /> 
</ClientSettings> 

Did I miss something or a property I need to set prior to EnableRowHoverStyle?




Thanks
Boris
Boris Iltsch
Top achievements
Rank 1
 answered on 06 Aug 2009
2 answers
265 views
I was trying to get the data item in SelectedIndexChanged.  Here is what I have:

    protected void Grid1_SelectedIndexChanged(object sender, System.EventArgs e)  
    {  
          
        GridItem item = Grid1.SelectedItems[0] as GridItem;  
        Customer cust = item.DataItem as Customer;  
    }  

where Customer is my data type for data binding.  The item object in the above codes is null.  Please help.  Thanks,

Peichung
Peichung
Top achievements
Rank 1
 answered on 06 Aug 2009
2 answers
155 views
Hi Team,

I use radgrid in that the properties i set true is AllowFiltering,AllowSorting and Allow Paging. For Editing i use the Imagebutton in the GridTemplateColoumn.when i click the edit Imagebutton the grid shows the inline editing even though i did not use the edit mode in the mastertableview 

Please help me
Thanks In Advance
srilatha
Top achievements
Rank 1
 answered on 06 Aug 2009
1 answer
135 views
Hi all,

Following the demo at http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx

Everything is great except that if the grid is empty and I try to insert a new record, the GridDropDownColumn in edit mode does not bind to the declared datasource. It seems the grid needs at least one record before it will bind the dropdown.

 <telerik:GridDropDownColumn DataField="answertype" DataSourceID="SqlDataSource3" 
                        HeaderText="Answer Type" ListTextField="answertype" ListValueField="atID" 
                        UniqueName="answertype" ColumnEditorID="GridDropDownColumnEditor1">  
</telerik:GridDropDownColumn> 

How can I force it to bind on edit please?

Cheers,

Jon

Veli
Telerik team
 answered on 06 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?