Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
156 views
I have a grid ( radGridDocs ) when the user clicks a linkbutton in the grid (which is in the UC, DocumentAccess) the modal window pops up and the client can enter their comments. When they are finished entering their comments and click submit, the desired behavior is for the window (docComments) to close and refresh the grid. I assume this will be done via Java script, but I am new to java scripting and require a little help.

Thanks,
Chuck
Shinu
Top achievements
Rank 2
 answered on 26 Aug 2011
1 answer
129 views
Update:

Telerik Please close this issue. I was able to able to fix it as suggested by Princy.

Basically, in Pre-Render event I hide the Default Expand/Collapse Column and rest I followed based on below link.


http://www.telerik.com/community/forums/aspnet-ajax/grid/gridexpandcolumn-expandimageurl-and-buttontype.aspx


Thanks Telerik and Princy.

gc_0620

___________________________________________________________________________________________

Folks using VS 2010 with RadGrid for ASP.Net Ajax 2011 V2.

I have a Hierarchical grid, Master Table HierarchyLoadMode="Client".

If use use expand/collapse Expand/Collapse ImageUrl from a File via ColumnCreated event, I got the attached error message while exporting to PDF. But If i do not call Column created event in Radgrid thus by using default Expand/Collapse ImageURL, the PDF export works fine. Also if  I use HierarchyLoadMode=Server or ServerOnDemand and call ColumnCreated event, export works fine. 
 
Any help appreciated..

Thanks

gc_0620

protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridExpandColumn)
        {
            (e.Column as GridExpandColumn).ButtonType = GridExpandColumnType.ImageButton;
  
            (e.Column as GridExpandColumn).ExpandImageUrl = "~/Images/grd_SinglePlus.gif";
            (e.Column as GridExpandColumn).CollapseImageUrl = "~/Images/grd_SingleMinus.gif";
  
        }
    }
 protected void Export_to_PDF_Click(object sender, System.EventArgs e)
    {
  
        RadGrid1.ExportSettings.ExportOnlyData = false;
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
        RadGrid1.ExportSettings.OpenInNewWindow = true;
           
        RadGrid1.MasterTableView.ExportToPdf();
    }
Princy
Top achievements
Rank 2
 answered on 26 Aug 2011
2 answers
779 views
Hi guys,
I have following code in my aspx page:

<

 

tr>

 

 

<td >

 

 

<p class="style" >

 

Please enter job posting number:

 

</p>

 

 

</td>

 

 

<td >

 

 

<telerik:RadNumericTextBox ID="JobPostingNo" runat="server" TabIndex="9" Font-Bold="true" MaxLength="4" Type="Number" MinValue="1" MaxValue="9999" CssClass="textbox" Width="48px" Enabled="false">

 

 

<NumberFormat GroupSeparator="" DecimalDigits="0" />

 

 

<DisabledStyle Font-Bold="true" BackColor="#EFEFEF" />

 

 

</telerik:RadNumericTextBox>

 

 

</td>

 

 

<td>

 

 

<asp:Image ID="JobPNErrImage" runat="server" Width="14px" Height="14px" ImageUrl="~/Image/error-icon.jpg" Visible="false" />

 

 

</td>

 

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<p class="style">

 

Have you met all of the criteria outlined in the posting?

 

</p>

 

 

</td>

 

 

<td>

 

 

<telerik:RadComboBox ID="ddlPost" runat="server" TabIndex="10" AutoPostBack="false" Font-Size="Small" Width="53px">

 

 

<Items>

 

 

<telerik:RadComboBoxItem Text="Select" Value="" Selected="true" />

 

 

<telerik:RadComboBoxItem Text="Yes" Value="Y" />

 

 

<telerik:RadComboBoxItem Text="No" Value="N" />

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

</td>

 


And here is a code behind file:

RadPanelBar

 

attestPanel = (RadPanelBar)formPanel.FindItemByValue("principalForm").FindControl("attestationPanel");

 

 

RadNumericTextBox jobPostNo = (RadNumericTextBox)attestPanel.FindItemByValue("principalattestaionInfo").FindControl("JobPostingNo");

 

 

RadComboBox ddlAprvPost = (RadComboBox)attestPanel.FindItemByValue("principalattestaionInfo").FindControl("ddlAprv");

 

 

if (ddlAprvPost.SelectedValue == "Y")

 

{

jobPostNo.Enabled =

true;

 

jobPostNo.Focus();

}

 

else

 

{

 

if (jobPostNo.Text.Length > 0)

 

{

jobPostNo.Text =

string.Empty;

 

}

jobPostNo.Enabled =

false;

 

 

}

My question is: when jobPostNo control is disabled how  to shift focus to the next control right after this control.

Thanks so much.

Vitaly
Top achievements
Rank 1
 answered on 25 Aug 2011
9 answers
822 views

I would be grateful for an example of how to wire-up some client-side javascript to the click event on a GridHyperlinkColumn. I have this markup:

 

 

 

 <MasterTableView>
 
<Columns>
 
<telerik:GridBoundColumn DataField="id" Visible="false" DataType="System.Int32"></telerik:GridBoundColumn>
 
<telerik:GridHyperlinkColumn DataTextField="companyname" DataNavigateUrlFields="companyURL" datatype="System.String">
 
</telerik:GridHyperlinkColumn>
 
</Columns>
 
</MasterTableView>

 

 

 

 

 

 

and I want to send the value of the DataNavigateUrlFields to a client-side javascript function when the hyperlink is clicked:

someClientSideFunction(  value of the DataNavigateUrlFields of the clicked item );

Thanks

vvvv
Top achievements
Rank 1
 answered on 25 Aug 2011
2 answers
414 views

Folks,

I am using ASP.Net Ajax Q2 2011 with VS 2010. Below is my Grid Table Laout.

        
        Parent Table

                                ---- Detail Table 1 (GridTableView Name = "Detail")

                                             --- Detail Table 1.1

                                ---- Detail Table 2

 
My desired expectations:

1) While I am scrolling rows in Parent Table, I would like to get the row counts of related Detail Table 1 but not row counts of other Detail Tables.

2) Also if I am scrolling rows in Detail Table 1, do nothing.
 

Below works to get the Row Count of Parent Table; but having some difficulty to getting row count of Related Detail Table 1.

function RowCount(sender, args)  
{  
   
    var grid = $find("<%=RadGrid1.ClientID %>");  
    var MasterTable = grid.get_masterTableView();  
    var Rows = MasterTable.get_dataItems();
    // Need Help here to get the Row Count of Detail Table 1 and Pass into TextBox RowCountTextBox...
    alert(Rows.length); 
    document.getElementById("<%=RowCountTextBox.ClientID %>").value = parseInt(Rows.length);
      
 }  

Rad Grid Settings:
'''

 

HierarchyLoadMode = "ServerBind"

 

'''
<ClientEvents OnFilterMenuShowing="filterMenuShowing" OnRowSelected = "RowCount" />
'''
'''
<asp:TextBox ID="RowCountTextBox" runat="server" Text="" Width = "400px"> </asp:TextBox>


I tried in Server Side Prerender event, but did not get the Child Table row count if Parent row is not expanded. 


Thanks

gc_0620
gc_0620
Top achievements
Rank 1
 answered on 25 Aug 2011
2 answers
107 views
Hello,

I have a telerik grid in which as a item template I have a checkbox..so it gets repeated at all rows..now In the header text I wanted a checkbox which if selected selects all the checkboxes on the page...can someone please tell me me how can I do that.

Thanks
JD
Top achievements
Rank 1
 answered on 25 Aug 2011
11 answers
224 views
Hello again,

I need some help to know how i can get a property from the selectedItem of my Radgrid, so i can execute a delete on a table on my database...

I'm populating data from a stored procedure, using entity.

EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
     RadGrid2.DataSource = objectContx.UsersAssignResume();
     RadGrid2.DataBind();

I need to when click a button "delete", get a property("UserName") from RadGrid2 selected Item, so i can use it like a parametter and execute a storeCommand like this:

objectContx.ExecuteStoreCommand(

 

"Delete from Table Where Table.UserName = @par");

 

Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Aug 2011
1 answer
125 views
Hello experts,

I have an export button on my RadGrid but it's working bad...The idea was to export a specific collumn...After some changes at this moment when i click to export, my grid shows the list to export, instead of give me a .csv....Can you help?

aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
    AllowSorting="True" AutoGenerateColumns="False" Width="97%" enableajax="True"
    AllowFilteringByColumn="True" ShowFooter="True" Skin="Black" OnItemCommand="RadGrid1_ItemCommand"
    OnGridExporting="RadGrid1_GridExporting" AllowMultiRowSelection="True" OnItemDataBound="RadGrid1_ItemDataBound">
    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="SequencialNumber" Width="100%" CommandItemSettings-ShowExportToCsvButton="True"
        CommandItemSettings-ShowAddNewRecordButton="false" CommandItemDisplay="Top">
        <Columns>
            <telerik:GridBoundColumn DataField="SequencialNumber" HeaderText="SequencialNumber"
                UniqueName="SequencialNumber" SortExpression="SequencialNumber">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Priority" HeaderText="Priority" UniqueName="Priority"
                FilterControlAltText="Filter Priority column" SortExpression="Priority" DataType="System.Int32">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Process" HeaderText="Staging" UniqueName="Process"
                SortExpression="Process" FilterControlAltText="Filter Process column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SupplierCode" HeaderText="SupplierCode" UniqueName="SupplierCode"
                SortExpression="SupplierCode" FilterControlAltText="Filter SupplierCode column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MessageStatus" HeaderText="MessageStatus" UniqueName="MessageStatus"
                SortExpression="MessageStatus" FilterControlAltText="Filter MessageStatus column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="DocumentType" HeaderText="DocumentType" UniqueName="DocumentType"
                FilterControlAltText="Filter DocumentType column" SortExpression="DocumentType">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn UniqueName="InvoiceCreationDate" DataField="InvoiceCreationDate"
                HeaderText="InvoiceCreationDate" FilterControlAltText="Filter InvoiceCreationDate column"
                SortExpression="InvoiceCreationDate">
                <FilterTemplate>
                    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
                    </telerik:RadDatePicker>
                </FilterTemplate>
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="SupplierVatNumber" FilterControlAltText="Filter SupplierVatNumber column"
                HeaderText="SupplierVatNumber" SortExpression="SupplierVatNumber" UniqueName="SupplierVatNumber">
            </telerik:GridBoundColumn>
        </Columns>
        <ExpandCollapseColumn Visible="False">
            <HeaderStyle Width="19px"></HeaderStyle>
        </ExpandCollapseColumn>
        <RowIndicatorColumn Visible="False">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>



aspx.cs:

public partial class InvoicesScalingDefault : iConnect.Web.iConnect, IInvoicesScale
    {
        private InvoicesScalePresenter _presenter;
  
        public System.Collections.Generic.IList<Data.SapDocuments> SapDocuments
        {
            get;
            set;
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
  
                this._presenter.OnViewInitialized();
  
                LoadData();
            }
            this._presenter.OnViewLoaded();
  
        }
  
        [CreateNew]
        public InvoicesScalePresenter Presenter
        {
            set
            {
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
  
        /// <summary>
        /// Carregar RadGrid1 com o objecto SapDocuments 
        /// </summary>
        private void LoadData()
        {
  
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
            RadGrid1.DataSource = objectContx.ShowUnprocessedInvoices(user);
            //RadGrid1.DataBind();
  
        }
  
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
            {
                RadGrid1.MasterTableView.Columns.FindByUniqueName("SequencialNumber").Visible = true;
                RadGrid1.ExportSettings.IgnorePaging = true;
  
                int count = 0;
                foreach (GridColumn column in RadGrid1.Columns)
                {
                    if (column.Visible)
                    {
                        if (count > 0)
                            column.Visible = false;
                        else
                            count++;
                    }
                }
  
            }
        }
  
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
        {
            e.ExportOutput = e.ExportOutput.Replace("\"\r\n\"", "\"\r\n\"'");
        }
Ricardo
Top achievements
Rank 1
 answered on 25 Aug 2011
3 answers
86 views
Hello,

i'm having a problem with my RadGrid, At this moment i need to bind data to my Grid using 2 diferent Store Procedures, mapped on my .edmx.

The idea is to have two buttons, each one to call a procedure. At this moment My problem is when I click on a collumn to sort data, my grid comes blank....I need to allow my RadGrid to sort collumns but for the specific procedure that was bind at last.

How can i do that?

My code is

public partial class InvoicesScalingDefault : iConnect.Web.iConnect, IInvoicesScale
    {
        private InvoicesScalePresenter _presenter;
  
        public System.Collections.Generic.IList<Data.SapDocuments> SapDocuments
        {
            get;
            set;
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
  
                this._presenter.OnViewInitialized();
  
                LoadData();
            }
            this._presenter.OnViewLoaded();
  
        }
  
        [CreateNew]
        public InvoicesScalePresenter Presenter
        {
            set
            {
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
  
        /// <summary>
        /// Carregar RadGrid1 com o objecto SapDocuments 
        /// </summary>
        private void LoadData()
        {
  
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
            RadGrid1.DataSource = objectContx.ShowUnprocessedInvoices(user);
            //RadGrid1.DataBind();
  
        }
  
  
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
        {
            e.ExportOutput = e.ExportOutput.Replace("\"\r\n\"", "\"\r\n\"'");
        }
  
protected void ShowProcessed_Click(object sender, EventArgs e)
        {
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
            RadGrid1.DataSource = objectContx.ShowProcessedInvoices(user);
            RadGrid1.DataBind();
  
  
        }
  
  
        protected void ShowUnProcessed_Click(object sender, EventArgs e)
        {
            LoadData();
  
        }
Ricardo
Top achievements
Rank 1
 answered on 25 Aug 2011
1 answer
85 views
I'm trying to add a control to a web page that allows the user to enter date values in a variety of ways, hoping the control will display in the correct format.  I currently use a date type in another product that automatically formats the input to the correct value.  Example:  if the user types in 05052005, the control should convert the value to 5/5/2005, conversely if the user enters 05/05/2005, the control should convert to 5/5/2005.

Any ideas or help is welcomed.
Tom Renfro
Top achievements
Rank 1
 answered on 25 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?