Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
395 views
I want to apply role management in a grid
I have 3 tables in the database 1. Role master 2.Action Master 3.RoleActionAssociation
the procedure is
@RoleID int
as
select actionname,isnull(ra.actionid,0) from actionmaster
left outer join
(select actionid from roleactionassociation where roleid=@RoleID
) ra
on (actionmaster.actionid=ra.actionid)

now this gets me all the names of the actions present alongside the actionids
if the role is associated then the actionid is displayed else its null

Now I want to display this in the grid ie if the actionid is null I need the checkbox to be checked else unchecked
Rad Grid is as follows
<telerik:RadGrid   AutoGenerateDeleteColumn="true"    ID="RolesActionsGrid" runat="server" AutoGenerateColumns="False" AllowAutomaticInserts="false"
    AllowAutomaticDeletes="false"  AllowPaging="true" allowSorting="true">
<MasterTableView>
<Columns>
<telerik:GridBoundColumn DataField="ActionName" HeaderText="Permissions" SortExpression="ActionName">


</telerik:GridBoundColumn>
<telerik:GridBoundColumn  DataField="ActionID" Visible="false" HeaderText="Permissions" SortExpression="ActionID">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn>
<HeaderTemplate>
<asp:CheckBox  runat="server" id="checkAll"/>
</HeaderTemplate>
<ItemTemplate >
<asp:CheckBox id="checkIndividual" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>

code behind

 Protected Sub DDRoles_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles DDRoles.SelectedIndexChanged

        Dim objActions As New clsActionMaster
        Dim objDataTable As New DataTable

        objDataTable = objActions.getActionsByRoleID(15).Tables(0)
        RolesActionsGrid.DataSource = objDataTable
        RolesActionsGrid.DataBind()

    End Sub


    Protected Sub RolesActionsGrid_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles RolesActionsGrid.DataBound
        For Each item As GridDataItem In RolesActionsGrid.Items


        Next



    End Sub

Even when I check uncheck the checkbox an appropriate function shld be called





Yavor
Telerik team
 answered on 16 Dec 2009
3 answers
125 views
Good morning,

Posting a strange issue which only manifests on IE8.  I have a fairly complex page which I have styled with CSS and used the telerik skins to style all of the controls.

When I load this page in IE8 I periodically get a flash of arrows, or an orange bar, or what looks like loading panels in random parts of the screen.  (see attached issue.png).

The other attachment no-issue.png is how the page should look.

This issue goes away if i wave my mouse over the affected area but it is still really annoying and I just know the end user will raise it as an issue.

Has anybody else had this issue?

Cheers,


James
Martin
Telerik team
 answered on 16 Dec 2009
2 answers
186 views
Hi all,

I'm trying to build a user control that has a radCombox on it.  One of the features of the combobox is that you can list the ID's of child radcomboboxes that will clear when the ItemsRequested event fires on the parent box.  However, when I run the following code to get the child radComboBox, the Item.count is always 0, and the items in the box never clear, even when I clearly see items in the child radComboBox.
 
  private void ClearChildren() 
    { 
        RelationalComboBox Child; 
 
        string[] ChildrenList = _Children.Split(_ChildrenDelimeter.ToCharArray()); 
 
        for (int i = 0; i < ChildrenList.Length; i++) 
        { 
            Child = (RelationalComboBox)this.Parent.FindControl(ChildrenList[i]); 
            Child.radComboBox.Text = " "; 
            Child.radComboBox.ClearSelection(); 
 
            do 
            { 
                if (Child.radComboBox.Items.Count > 0) 
                { 
                    Child.radComboBox.Items[0].Remove(); 
                } 
            } while (Child.radComboBox.Items.Count > 0); 
 
 
      
        } 
    } 


Any ideas how I can get the other radComboBox control and clear it's items?  

Thanks,
Joshua Wise
Aramark





Simon
Telerik team
 answered on 16 Dec 2009
1 answer
101 views

 

I'm showing a radalert window on page load.

All works OK, except the text I'm displaying on the master page comes up bigger than what it does when I'm not showing the radalert window?

Any ideas?


Thanks.

Georgi Tunev
Telerik team
 answered on 16 Dec 2009
1 answer
143 views
Hi

Is it posible to have the RadAjaxLoadingPanel dim (I dont mean dimention I mean make darker) the background when its updating in the same way the RadWindow does when it pops up?

Andy
Shinu
Top achievements
Rank 2
 answered on 16 Dec 2009
2 answers
100 views
Help.
I can't identify what happen with the sort capability in my routines.
I would like that the data sort occurr in the client-side.
Thanks
Eloi
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CSExcel.aspx.cs" Inherits="CSExcel" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
    Namespace="System.Web.UI" TagPrefix="asp" %> 
 
<!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">  
    <title>Import Excel Data into GridView</title> 
</head> 
 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True">  
    </telerik:RadScriptManager> 
    <div> 
        <asp:FileUpload ID="FileUpload1" runat="server" /> 
        <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" /> 
        <br /> 
        <asp:Label ID="Label1" runat="server" Text="Has Header ?"></asp:Label> 
        <asp:RadioButtonList ID="rbHDR" runat="server">  
            <asp:ListItem Text="Yes" Value="Yes" Selected="True"></asp:ListItem> 
            <asp:ListItem Text="No" Value="No"></asp:ListItem> 
        </asp:RadioButtonList> 
    </div> 
    <br /> 
    <div> 
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" 
            GridLines="Horizontal" OnSortCommand="RadGrid1_SortCommand" PageSize="50">  
            <MasterTableView AutoGenerateColumns="True">  
                <DetailTables> 
                    <telerik:GridTableView runat="server" Width="100%">  
                        <Columns> 
                            <telerik:GridBoundColumn SortExpression="CodAluno" HeaderText="CodAluno" HeaderButtonType="TextButton" 
                                DataField="CodAluno" /> 
                            <telerik:GridBoundColumn SortExpression="CodTurma" HeaderText="CodTurma" HeaderButtonType="TextButton" 
                                DataField="CodTurma" /> 
                            <telerik:GridBoundColumn SortExpression="NomeAluno" HeaderText="NomeAluno" HeaderButtonType="TextButton" 
                                DataField="NomeAluno" /> 
                            <telerik:GridBoundColumn SortExpression="EmailAluno" HeaderText="EmailAluno" HeaderButtonType="TextButton" 
                                DataField="EmailAluno" /> 
                        </Columns> 
                    </telerik:GridTableView> 
                </DetailTables> 
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <SortExpressions> 
                    <telerik:GridSortExpression FieldName="CodAluno" SortOrder="Ascending" /> 
                </SortExpressions> 
            </MasterTableView> 
        </telerik:RadGrid> 
    </div> 
    </form> 
</body> 
</html> 
 
using System;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using System.Data;  
using System.Data.OleDb;  
using System.IO;  
using System.Configuration;  
using System.Drawing;  
using System.Text;  
using Telerik.Web.UI;  
 
public partial class CSExcel : System.Web.UI.Page   
{  
    public string FileName;  
 
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
    protected void btnUpload_Click(object sender, EventArgs e)  
    {  
        if (FileUpload1.HasFile)  
        {  
            string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);  
            string Extension = Path.GetExtension(FileUpload1.PostedFile.FileName);  
            string FolderPath = ConfigurationManager.AppSettings["FolderPath"];  
            string FilePath = Server.MapPath(FolderPath + FileName);  
            FileUpload1.SaveAs(FilePath);  
            Import_To_Grid(FilePath, Extension, rbHDR.SelectedItem.Text);  
        }  
    }  
    //  
    private void Import_To_Grid(string FilePath, string Extension, string isHDR)  
    {  
        string conStr="";  
        switch (Extension)  
        {  
            case ".xls": //Excel 97-03  
                conStr = ConfigurationManager.ConnectionStrings["Excel03ConString"].ConnectionString;  
                break;  
            case ".xlsx": //Excel 07  
                conStr = ConfigurationManager.ConnectionStrings["Excel07ConString"].ConnectionString;  
                break;  
        }  
        conStr = String.Format(conStr, FilePath, isHDR);  
        OleDbConnection connExcel = new OleDbConnection(conStr);  
        OleDbCommand cmdExcel = new OleDbCommand();  
        OleDbDataAdapter oda = new OleDbDataAdapter();  
        DataTable DadosImportados = new DataTable();   
        cmdExcel.Connection = connExcel;  
 
        //Get the name of First Sheet  
        connExcel.Open();  
        DataTable dtExcelSchema;  
        dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);  
        string SheetName = dtExcelSchema.Rows[0]["TABLE_NAME"].ToString();  
        connExcel.Close();  
 
        //Read Data from First Sheet  
        connExcel.Open();  
        cmdExcel.CommandText = "SELECT * From [" + SheetName + "]";  
        oda.SelectCommand = cmdExcel;  
        oda.Fill(DadosImportados);  
        connExcel.Close();   
 
        //Bind Data to GridView  
        RadGrid1.DataSource = DadosImportados;  
        RadGrid1.DataBind();  
    }  
    //  
      
    //  
    protected void PageIndexChanging(object sender, GridViewPageEventArgs e)  
    {  
        string FolderPath = ConfigurationManager.AppSettings["FolderPath"];  
        string Extension = Path.GetExtension(FileName);  
        string FilePath = Server.MapPath(FolderPath + FileName);  
 
        Import_To_Grid(FilePath, Extension, rbHDR.SelectedItem.Text);  
        RadGrid1.CurrentPageIndex = e.NewPageIndex;  
        RadGrid1.DataBind();  
 
    }  
    //protected void RadGrid1_SortCommand(object source, Telerik.Web.UI.GridSortCommandEventArgs e)  
    //{  
    //    GridSortExpression expression = new GridSortExpression();  
    //    expression.FieldName = "CodAluno";  
    //    expression.SortOrder = GridSortOrder.Descending;  
    //    RadGrid1.MasterTableView.SortExpressions.AddSortExpression(expression);  
    //    RadGrid1.MasterTableView.Rebind();   
    //}  
    //  
    protected void RadGrid1_SortCommand(object source, GridSortCommandEventArgs e)  
    {  
        GridTableView tableView = e.Item.OwnerTableView;  
         
            e.Canceled = true;  
            GridSortExpression expression = new GridSortExpression();  
            expression.FieldName = "EmployeeID";  
            if (tableView.SortExpressions.Count == 0 ||  
                tableView.SortExpressions[0].FieldName != "EmployeeID")  
            {  
                expression.SortOrder = GridSortOrder.Descending;  
            }  
            else if (tableView.SortExpressions[0].SortOrder == GridSortOrder.Descending)  
            {  
                expression.SortOrder = GridSortOrder.Ascending;  
            }  
            else if (tableView.SortExpressions[0].SortOrder == GridSortOrder.Ascending)  
            {  
                expression.SortOrder = GridSortOrder.None;  
            }  
            tableView.SortExpressions.AddSortExpression(expression);  
            tableView.Rebind();  
          
    }   
 
}  
 

 

Eloi
Top achievements
Rank 1
 answered on 16 Dec 2009
1 answer
103 views
Hi

when i add the rad  editor web part to my page , it gets added but only with title. i cant see the any editor controls inside its blank ... did i miss anything when adding .?? 

Downloaded :  RadEditorMOSS_5_6_1.zip
Lini
Telerik team
 answered on 16 Dec 2009
3 answers
300 views
I am trying to render a textbox for each day of a calendar, but I am getting an exception.

Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

Can someone tell me how to accomplish this?

<telerik:RadCalendar ID="calendar" Width="500px" Height="400px" runat="server" OnDayRender="calendar_DayRender">  
            <CalendarDayTemplates> 
                <telerik:DayTemplate ID="templateMinutes">  
                    <Content> 
                        <telerik:RadTextBox ID="txtMinutes" runat="server" Columns="5">  
                        </telerik:RadTextBox> 
                    </Content> 
                </telerik:DayTemplate> 
            </CalendarDayTemplates> 
        </telerik:RadCalendar> 
Mira
Telerik team
 answered on 16 Dec 2009
1 answer
161 views
Hi,

I'm trying to find a basic example showing how to implement a foreign key lookup in the RadGrid. I have seen several examples of adding a combo to the grid, but can't find any real world examples that link a primary table with a foreign key table.

I have managed to get the lookup combo populated whilst in add/edit mode, but in the main grid it still shows the FK Id instead of the text field, although in trying to get it to work, I now seem to have broken the edit mode.

Basically I have..

[Contacts]
(pk) ContactID
(fk) ContactTypeID
ContactName
ContactNumber
...

[ContactTypes]
(pk) ContactTypeID
ContactType


The Grid columns should be..

ContactType, ContactName, ContactNumber, ...

In Add/Edit mode, ContactType should be a combo populated from the ContactTypes table.

thanks

Cesare
Yavor
Telerik team
 answered on 16 Dec 2009
1 answer
102 views
I've got a requirement to support clients in Third World areas.  Bandwidth is a critical issue.
I've got a radCastTabStrip and am finding that it is creating a lot of unnecessary markup in the browser (I've got several other Telerik RAD controls as well which likely have a similar problem) .
I think its creating a lot of bloated ViewSpace, but I know that the radTabStrip is creating a chain of nested span tags for each item.
Is there a way to strip out all the markup tags so that I can just use my own CSS stylesheets?
Are there any other suggestions you can offer to optimize RAD controls for low bandwidth?

A related question, as is, each <li>, <a>, and <span> tag created by the radTabStrip has its own CSS class explicitly added.
For low bandwidth, this is serious bloat.  Is there a way to remove these so that I can assign CSS based on the radTabStrip's own id/class?
T. Tsonev
Telerik team
 answered on 16 Dec 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?