Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
Hi
Please give me sample code on how to refer editable or insert controls like textbox and dropdownlist in Javascript function for client side validations

Thanks
Krishna
Princy
Top achievements
Rank 2
 answered on 16 Jul 2008
1 answer
140 views
Hi There,

I am new to using your components but I have run into a problem that I can't find a way around.

I am trying to wrap the grid into a user control so that we can just set some basic properties and have it load the data (IE a sql statement). When I do this the grid works fine but if any kind of postback occurs the grid loses the column captions. The only unusual thing I am doing is that I have a property on my user control that allows columns to be specified in the ASPX file, these are then added to the rad grid:

<uc1:Grid ID="Grid1" runat="server" SQL="SELECT * FROM v_Requirement_AllFields" >

<Columns>

<telerik:GridHyperLinkColumn DataNavigateUrlFields="Requirement_RequirementId" DataNavigateUrlFormatString="ViewRequirement.aspx?RequirementId={0}" HeaderText="Reference" DataTextField="Requirement_RequirementReference"></telerik:GridHyperLinkColumn>

</Columns>

</uc1:Grid>


The code in my user control is very simple, basically as follows:

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not Page.IsPostBack Then

For Each col As GridColumn In Columns

telerikGrid.Columns.Add(col)

Next

End If

End Sub

Protected Sub telerikGrid_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles telerikGrid.NeedDataSource

If Not String.IsNullOrEmpty(_sql) Then

telerikGrid.DataSource = GetDataStore(

Me.Page).GetDataTable(_sql)

End If

End Sub

I have tried this with both Ajax enabled or disabled.

Any ideas?

Vlad
Telerik team
 answered on 16 Jul 2008
1 answer
156 views
Hi
I have a delete column in the grid and i want give custom confirmText to that.
i want specify something like below

ConfirmText

="Are you sure you want to delete details of" + "<EmployeeName>"


EmployeeName is the one of the field in the grid

Thanks
-Krishna
Shinu
Top achievements
Rank 2
 answered on 16 Jul 2008
2 answers
117 views
Hello guys, 

    I am using radmenu and it is binded through a database. The code looks something like this. 

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

//CODE TO GET THE POPULATED DATASET STARTS


classMenuListing
MenuListing = new classMenuListing();

DataSet ds = new DataSet();

ds = MenuListing.getMenuAgainstRole(ds, 14);

//CODE TO GET THE POPULATED DATASET ENDS

MenuBar.DataFieldID =

"ID";

MenuBar.DataFieldParentID =

"ParentID";

MenuBar.DataNavigateUrlField =

"LinkBasicURL";

MenuBar.DataTextField =

"LinkDisplayText";

MenuBar.DataSource = ds;

MenuBar.DataBind();

}

}

I have a field in the database which provides access keys for each menu item. How will i bind the accesskey field to the radmenu. Like I binded (MenuBar.DataNavigateUrlField = "LinkBasicURL";) URL field.

Thanks,
Mansoor Nadeem

Mansoor
Top achievements
Rank 1
 answered on 16 Jul 2008
1 answer
143 views
hi

i cant find any info about this and the $get function. I was trying to follow some radgrid tutorials but didnt work.

Thanks
Shinu
Top achievements
Rank 2
 answered on 16 Jul 2008
2 answers
160 views
Hi,
I am having a problem getting popups to appear in front of a flash movie.  I have added the wmode="transparent" param to the object, and embed tags, but still no joy.   The menues work fine, but not the popups...

Thanks
Lance
Lance
Top achievements
Rank 1
 answered on 15 Jul 2008
7 answers
235 views

This load the usercontrol - that has a grid with AllowFilteringByColumn="True".  When u filter once it works, but any other time or if u click on the edit button inside the grid.  You get javascript errors.  Only javascript actions cause the error.  Any server side action doesn't cause error.

If I don't load the page dynamically and just drag the usercontrol over, there are no problems.



protected
void Page_Load(object sender, EventArgs e)

{

UserControl ucControl;

// Insert some whitespace

this.Controls.Add(new LiteralControl("<br />"));

string fileName = Request.QueryString["f"].ToString();

 

ucControl = (

UserControl)LoadControl("~/Admin/Forms/" + fileName + ".ascx");

ucControl.ID = fileName;

pnlControl.Controls.Add(ucControl);

}

Jomey
Top achievements
Rank 1
 answered on 15 Jul 2008
1 answer
178 views
I'm currently changing my code from Q3 2007 to Q1 2008 with RadGrid and have a problem. I created a Delete Column inside the grid and when the user clicks on it is supposed to open the RadWindow but it doesn't. It worked in Q3 2007 but not here. Is there something I'm missing ?

Thanks

<rad:RadCodeBlock ID="RadCodeBlock1" runat="server">  
// ******** Category Functions ********  
            function ShowDeleteCategoryForm(categoryID, productID, rowIndex)  
            {  
                  
                // $find instead of window replaced [] with ()  
                var grid = window["<%= rgCategory.ClientID %>"];  
                 
                var rowControl = grid.MasterTableView.Rows[rowIndex].Control;   
                  
                grid.MasterTableView.SelectRow(rowControl, true);  
                           
                window.radopen("Edit_Product/DeleteCategory.aspx?CategoryID=" + categoryID + "&ProductID=" + productID, "DeleteCategory");  
                return false;   
            }  
function CloseCategory()  
            {  
                // $find instead of window  
                window["<%= rgCategory.ClientID %>"].AjaxRequest('<%= rgCategory.UniqueID %>', 'RebindAndNavigateCategory');  
            }  
 </script> 
        </rad:RadCodeBlock> 
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 

<rad:RadGrid ID="rgCategory" runat="server" Visible="false" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderWidth="0px" GridLines="None" Skin="Office2007" ShowStatusBar="True" BorderColor="#BFDBFF" Font-Size="8.5pt" Font-Names="Verdana" CellPadding="5" CellSpacing="5" OnItemCreated="rgCategory_ItemCreated">  
                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> 
                        <MasterTableView DataKeyNames="CategoryID,ProductID,SystemID" CommandItemDisplay="Bottom" > 
                          
                            <RowIndicatorColumn Visible="False">  
                                <HeaderStyle Width="20px" /> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Resizable="False" Visible="False">  
                                <HeaderStyle Width="20px" /> 
                            </ExpandCollapseColumn> 
                          
                            <Columns> 
                                <rad:GridBoundColumn DataField="CategoryID" DataType="System.Int32" SortExpression="CategoryID" UniqueName="CategoryID" HeaderText="CategoryID" Visible="False" /> 
                              
                                <rad:GridBoundColumn DataField="ProductID" DataType="System.Int32" SortExpression="ProductID" UniqueName="ProductID" HeaderText="ProductID" Visible="False" /> 
                                  
                                <rad:GridBoundColumn DataField="SystemID" DataType="System.Int32" SortExpression="SystemID" UniqueName="SystemID" HeaderText="SystemID" Visible="False" /> 
                                                                    
                                <rad:GridBoundColumn DataField="Name" HeaderText="Category" UniqueName="Name">  
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                    <ItemStyle HorizontalAlign="Center" /> 
                                </rad:GridBoundColumn> 
                              
                                <rad:GridBoundColumn DataField="Deleted" HeaderText="Deleted" UniqueName="Deleted" Visible="True">  
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                    <ItemStyle HorizontalAlign="Center" /> 
                                </rad:GridBoundColumn> 
                              
                                <rad:GridBoundColumn DataField="CreatedOn" HeaderText="Created On" UniqueName="CreatedOn">  
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                    <ItemStyle HorizontalAlign="Center" /> 
                                </rad:GridBoundColumn> 
                              
                                <rad:GridBoundColumn DataField="CreatedBy" HeaderText="Created By" UniqueName="CreatedBy">  
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                    <ItemStyle HorizontalAlign="Center" /> 
                                </rad:GridBoundColumn> 
                              
                                <rad:GridBoundColumn DataField="LastModifiedOn" HeaderText="Modified On" UniqueName="LastModifiedOn" Visible="False">  
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                    <ItemStyle HorizontalAlign="Center" /> 
                                </rad:GridBoundColumn> 
                              
                                <rad:GridBoundColumn DataField="LastModifiedBy" HeaderText="Modified By" UniqueName="LastModifiedBy" Visible="False">  
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                    <ItemStyle HorizontalAlign="Center" /> 
                                </rad:GridBoundColumn> 
                                  
                                <rad:GridTemplateColumn UniqueName="TemplateDeleteColumn">  
                                    <ItemTemplate> 
                                        <asp:HyperLink ID="DeleteLink" runat="server">  
                                        <asp:Image ID="DeleteCategory" runat="server" ImageUrl="~/RadControls/Grid/Skins/Delete.gif" AlternateText="Delete Category" /> 
                                        </asp:HyperLink> 
                                    </ItemTemplate> 
                                </rad:GridTemplateColumn> 
                                            
                            </Columns> 
                              
                            <CommandItemTemplate> 
                                <div style="text-align: left ">  
                                    <br /> 
                                    <asp:HyperLink ID="AddLink" runat="server" Visible="false">  
                                    <asp:Image ID="AddRecord1" runat="server" ImageUrl="~/RadControls/Grid/Skins/AddRecord.gif" AlternateText="Add Category" /> 
                                    Add Category</asp:HyperLink> 
                                    <br /><br /> 
                                </div> 
                            </CommandItemTemplate> 
                              
                        </MasterTableView> 
                          
                        <ClientSettings> 
                            <Selecting AllowRowSelect="True" /> 
                        </ClientSettings> 
                          
                </rad:RadGrid> 


 <rad:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Office2007" Behavior="Close">  
           <Windows> 
<rad:RadWindow ID="DeleteCategory" runat="server" Width="450px" Height="180px" Title="Delete" Skin="Office2007" Modal="true" OnClientClose="CloseCategory" /> 
               <rad:RadWindow ID="AddNewCategory" runat="server" Width="755px" Height="600px" Title="Add New" Skin="Office2007" Modal="true" OnClientClose="CloseCategory" /> 
  </Windows> 
       </rad:RadWindowManager>   
        

Here is the code behind

protected void rgCategory_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)  
        {  
            if (e.Item is GridDataItem)  
            {  
                HyperLink deleteLink = e.Item.FindControl("DeleteLink") as HyperLink;  
                deleteLink.Attributes["href"] = "#";  
                deleteLink.Attributes["onclick"] = string.Format("return ShowDeleteCategoryForm('{0}','{1}','{2}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CategoryID"], e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ProductID"], e.Item.ItemIndex);  
            }  
 
            if (e.Item is GridCommandItem)  
            {  
                  
                HyperLink addLink = e.Item.FindControl("AddLink") as HyperLink;  
                addLink.Visible = true;  
                addLink.Attributes["href"] = "#";  
                addLink.Attributes["onclick"] = string.Format("return ShowInsertCategoryForm('{0}','{1}');", productID, systemID);  
              
            }  
 
        } 

    protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument)  
        {  
            base.RaisePostBackEvent(sourceControl, eventArgument);  
 
            if (sourceControl is RadGrid)  
            {  
                switch (eventArgument)  
                {  
                    case "RebindAndNavigateCategory":  
                        rgCategory.MasterTableView.SortExpressions.Clear();  
                        rgCategory.MasterTableView.GroupByExpressions.Clear();  
                        rgCategoryrgCategory.MasterTableView.CurrentPageIndex = rgCategory.MasterTableView.PageCount - 1;  
                        rgCategory.Rebind();  
                        break;  
         }  
            }  
 
        } 
PPI Itdept
Top achievements
Rank 1
 answered on 15 Jul 2008
2 answers
107 views
After installing the RadEditor, I enabled the features on a site to use RadEditor as the default rich text editor for list items.  When trying to use this feature on a list, I only see the 2nd 1/2 of the toolbar (ie No spell check or hyperlink buttons, etc).  Is there something additional I should enable? 

Thanks in advance
Julian
Top achievements
Rank 1
 answered on 15 Jul 2008
3 answers
151 views
Hi..
If you have any code snippet to attach the Javascript funtion to Insert and Update record buttons of command items Please send it to me.

Thanks
-krishna

Krishna
Top achievements
Rank 1
 answered on 15 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?