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

I want to read GridBoundColumn value inside radgrid update command ..

how to acces bound column inside rad grid update commmand event.


Thanks
Princy
Top achievements
Rank 2
 answered on 29 Nov 2013
3 answers
120 views
Hi,
how can i do increase Textbox width and validation in automatic editmode alongwith i am using custom template mode for insert
previously i used like this but its not working now
i have also attached image ,look it for reference

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
   {
       if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
       {
           //-------------Find TextBox In EditMode And Apply Css To Them------------
           //GridEditableItem edititem = (GridEditableItem)e.Item;
           //TextBox TxtEntityName = (TextBox)edititem["EntityName"].Controls[0];
           //TextBox TxtEntityType = (TextBox)edititem["EntityType"].Controls[0];
           //TextBox TxtEntityPath = (TextBox)edititem["EntityPath"].Controls[0];
           //TextBox TxtDescription = (TextBox)edititem["Description"].Controls[0];
           //TextBox TxtFileName = (TextBox)edititem["FileName"].Controls[0];
           //TxtEntityName.CssClass = "riEditFormTextBox";
           //TxtEntityType.CssClass = "riEditFormTextBox";
           //TxtEntityPath.CssClass = "riEditFormTextBox";
           //TxtDescription.CssClass = "riEditFormTextBox";
           //TxtFileName.CssClass = "riEditFormTextBox";
       }
 
           //Validations For Textbox In Insert And Edit Mode
       if ((e.Item is GridEditableItem && e.Item.IsInEditMode) || (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted))
       {
           GridEditableItem item = e.Item as GridEditableItem;
           GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)item.EditManager.GetColumnEditor("EntityName");
           TableCell cell = (TableCell)editor.TextBoxControl.Parent;
           RequiredFieldValidator validator = new RequiredFieldValidator();
           validator.ControlToValidate = editor.TextBoxControl.ID;
           validator.ErrorMessage = " * Required";
           validator.Font.Bold = true;
           cell.Controls.Add(validator);
       }
Thanks
Shinu
Top achievements
Rank 2
 answered on 29 Nov 2013
3 answers
238 views
Hi telerik, 
I have a problem using the RadAjaxManager Control, I'm trying to load a combobox depending on the selected item in another combobox in a webform, but for do that the autopostback of the combobox has to be in true mode, so i add a RadAjaxManager so I would not reload the whole page, but it doesn't work.

I want to load the combobox cmbCuenta depending on the selected item in cmbBanco without reload the whole page. Thanks, for your help.

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
        <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="cmbBanco">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cmbCuenta" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cmbCuenta">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cmbChequera" />
                        <telerik:AjaxUpdatedControl ControlID="cmbMoneda" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="cmbTipoCuentaC">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cmbCuentaContable" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager> 

 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2010Silver">
            <div class="loading">
            <asp:Image ID="Image1" runat="server" ImageUrl="~/Imagenes/loading1.gif" AlternateText="loading"></asp:Image>
            </div>
        </telerik:RadAjaxLoadingPanel>  


<table align="center" style="width: 98%">
                <tr>
                    <td class="auto-style4">
                        Banco:
                    </td>
                    <td colspan="2" class="auto-style4">
                        <telerik:RadComboBox ID="cmbBanco" runat="server" AutoPostBack="true" DataSourceID="SqlDataBanco" DataTextField="Nombre" DataValueField="IdBanco" EmptyMessage="Seleccione un Banco" OnSelectedIndexChanged="cmbBanco_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align: top; width: 20%" align="left" class="auto-style5">
                        <asp:Label ID="lblCuenta" runat="server" Text="Cuenta:"></asp:Label>
                    </td>
                    <td style="vertical-align: top; width: 30%" align="left">
                        <telerik:RadComboBox ID="cmbCuenta" Runat="server" Width="211px" AutoPostBack="true" OnSelectedIndexChanged="cmbCuenta_SelectedIndexChanged" EmptyMessage="Seleccione una Cuenta Bancaria">
                        </telerik:RadComboBox>
                    </td>
                    <td style="vertical-align: top; width: 20%" align="left" class="auto-style3">
                        <asp:Label ID="lblFecha" runat="server" Text="Fecha de emisión:"></asp:Label>
                    </td>
                    <td style="vertical-align: top; width: 30%" align="left" class="auto-style4">
                        <telerik:RadDatePicker ID="dttFechaEmision" runat="server">                            
                        </telerik:RadDatePicker>
                    </td>
                </tr>
            </table>
</asp:Content>
Shinu
Top achievements
Rank 2
 answered on 29 Nov 2013
1 answer
290 views
Hi,
I am having data in Session and casting it to a Datatable.
and I want to delete some of the rows from that Datatable based on a comparison (please the code below).
it doesnt give the expected result.
could you please advise me on this??


           
            DataTable dtchange = (DataTable)Session["Data"];
            DataSet ds = getdata(txt_HideDual.Text.ToString());
            if (dtchange.Rows.Count != 0)
            {
                for (int i = 0; i < dtchange.Rows.Count; i++)
                {
                    for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                    {
                        if (dtchange.Rows[i]["Name"].ToString() == ds.Tables[0].Rows[j]["Name"].ToString())
                        {
                            //dtchange.Rows.RemoveAt(i); --- This doesnt work
                            dtchange.Rows[i].Delete();
                            dtchange.AcceptChanges();
                        }
                    }
                }
                             Session["Data"] = dtchange;
            }


Thanking you,


AGM Raja
Shinu
Top achievements
Rank 2
 answered on 29 Nov 2013
2 answers
54 views
Hi,

we are displaing more than 120 columns in the Radgrid which are generated dynamically from the Store Procedure.  we have enabled sorting, Filtering and DragandDrop.

The issue is that, some of the columns in the right most side is not visible when scrolling.

I have even set the Header Item style width and Filter Control width. Still it doesn' t work.

Any fix or work around for this?

Best Regards,
satz

Satz
Top achievements
Rank 1
 answered on 29 Nov 2013
1 answer
66 views
Can someone please look at the demo link below?

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultvb.aspx?product=grid#qsf-demo-source

When I clicked on Add New Record link button to bring up the Edit form, I could not find the code the show the Edit form (please see attachment for the screenshot)

Thanks,
Sam
Shinu
Top achievements
Rank 2
 answered on 29 Nov 2013
1 answer
99 views
I wrote an application for a client earlier this year that enables drag and drop functionality between two grids (assigned measures and available measures).  The drag and drop works for most of their associates but for a few, it's not functional and they would like me to create a secondary way for them to select and move measures.

They asked for a single button that would allow them to select one or more rows in the available grid, click the button, and move selected rows to the assigned grid, but I thought in my research earlier this year that I found that wasn't possible.  Is it?  Or is it possible to create a command column in each grid with, for example, an arrow pointing to the other grid that when clicked would move the row?

Looking for a push in the right direction on this and examples would be greatly appreciated.

Thanks!
Pavlina
Telerik team
 answered on 28 Nov 2013
3 answers
96 views
I'm making  a grid that displays file system directories and files as a hierarchy
The problem is it only works fine for only the first level of hierarchy, what I should do to make this supports unlimited levels.

here is my code:
ASPX:
<div>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowEdit="True"
            AutoGenerateHierarchy="True" CellSpacing="0" GridLines="None"
            Skin="Windows7" ondetailtabledatabind="RadGrid1_DetailTableDataBind">
            <MasterTableView  DataKeyNames="FullName,IsDirectory,ParentDirectory">
                <DetailTables>
                    <telerik:GridTableView  AutoGenerateColumns="true" DataKeyNames="FullName,IsDirectory,ParentDirectory">
                    </telerik:GridTableView>
                </DetailTables>
            </MasterTableView>
        </telerik:RadGrid>
    </div>


Code File:
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            List<FileWrapper> dirs  = new DirectoryInfo("C://").GetDirectories().Select(obj => new FileWrapper(obj, true)).ToList();
            List<FileWrapper> files = new DirectoryInfo("C://").GetFiles().Select(obj => new FileWrapper(obj, true)).ToList();
            dirs.AddRange(files);
            RadGrid1.DataSource = dirs;
            RadGrid1.DataBind();
        }
 
    }
 
    protected void RadGrid1_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
    {
 
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
 
        bool isDirectory = bool.Parse(dataItem.GetDataKeyValue("IsDirectory").ToString());
        string FullName = dataItem.GetDataKeyValue("FullName").ToString();
 
        if (isDirectory)
        {
            DirectoryInfo d = new DirectoryInfo(FullName);
            List<FileWrapper> dirs = d.GetDirectories().Select(obj => new FileWrapper(obj, false)).ToList();
            List<FileWrapper> files = d.GetFiles().Select(obj => new FileWrapper(obj, false)).ToList();
            dirs.AddRange(files);
            e.DetailTableView.DataSource = dirs;
        }
    }
 
 
 
 
}
 
 
 
public class FileWrapper
{
    public string Name { get; set; }
    public string FullName { get; set; }
    public bool IsDirectory { get; set; }
    public DateTime CreationTime { get; set; }
    public string ParentDirectory { get; set; }
    public List<FileWrapper> Children { get; set; }
 
    public FileWrapper(object o, bool isRoot)
    {
 
        if (o is FileInfo)
        {
            FileInfo f = (FileInfo)o;
            Name = f.Name;
            FullName = f.FullName;
            CreationTime = f.CreationTime;
            IsDirectory = false;
            if (!isRoot)
            {
                ParentDirectory = f.Directory.FullName;
            }
             
        }
 
        if (o is DirectoryInfo)
        {
            DirectoryInfo d = (DirectoryInfo)o;
            Name = d.Name;
            FullName = d.FullName;
            CreationTime = d.CreationTime;
            IsDirectory = true;
            if (!isRoot)
            {
                ParentDirectory = d.Parent.FullName;
            }
             
        }
    }
}

Pavlina
Telerik team
 answered on 28 Nov 2013
3 answers
83 views

Have deployed a website to Azure websites and one of the pages has a SocialShare Send Email button.  The popup send email form includes the Radcaptcha and by default has the "Get Audio Code" option.







When visiting the page I get a message "This web page wants to run the following add-on: 'Windows Media Player"  It took me awhile to figure out why and than noticed that the popup form generated from SocialShare SendEmail has the Audio code option.



So when debugging the page (on the basis that a user chooses not to select the Allow) when proceeding to redirect the page I get error:  "An unhandled exception of type 'System.NullReferenceException' occurred in System.Speech.dll"



(note I don't get this error when running local). 







I am assuming this is being caused by the SocialShare Radcaptcha needing the add-on and errors out without it.



In any case I am happy to disable the AudioCode option as I have also done this on another Radcaptcha on the same page.







Is there a way to disable the Audiocode option on SocialShare Send Email button?







Thanks











Danail Vasilev
Telerik team
 answered on 28 Nov 2013
1 answer
76 views
Hi,

I have a simple page with a RadUpload, RadProgressArea and RadProgressManager.
When visitors upload one or more files, click on 'Upload Files', the files start uploading and the RadProgressArea 
appears.

So far so good.

After uploading, I do a Request.RawUrl, meaning it reloads the page, binds a grid and shows the uploaded files.

Inside this grid there is a Download button. When you click this button, the file will be downloaded (forced with the Save As dialog).
When you click this buttons, the RadProgressArea appears again, and can't be cancelled or whatever.

I don't want this thing to show up, but only when actually uploading files.

Can I do something about it?

Thanks,
Daniel
Hristo Valyavicharski
Telerik team
 answered on 28 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?