Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
177 views
 
I have the following radgrid, when I put the clientevent - OnCommand - "OnGridCommand" the serverevent
 
OnItemDataBound="gridInvLines_ItemDataBound" is not being called - why is that ? How can I modify the code to call the serverevent or move the server code to client event ?
 
Basically I am trying to check if the page is valid or not , if the page is valid only then open the popup and load some preexisting values else do not open the popup. The code works except the values are not being generated i.e. OnItemDataBound="gridInvLines_ItemDataBound is not being called ?
 
 
 
<telerik:RadGrid ID="gridInvLines" AllowPaging="False" Skin="Office2007"

 

runat="server" AutoGenerateColumns="False" DataSourceID="odsInvLines"

 

GridLines="None" OnItemDataBound="gridInvLines_ItemDataBound" ShowFooter="True">

 

<ClientSettings >

 

<ClientEvents OnKeyPress="disableEnterKey" OnCommand="OnGridCommand" OnPopUpShowing="PopUpShowing" />

 

</ClientSettings>

 

<MasterTableView DataKeyNames="LINE_NUMBER" DataSourceID="odsInvLines" EditMode="PopUp" InsertItemDisplay="Top" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add New Line">

 

<Columns>

 

<telerik:GridEditCommandColumn ButtonType="LinkButton" InsertText="Save" UniqueName="EditButton">

 

<ItemStyle HorizontalAlign="Center" Width="30px" />

 

</telerik:GridEditCommandColumn>

 

</Columns>

 

 

<EditFormSettings EditColumn-UpdateText="Save" EditColumn-InsertText="Save" CaptionFormatString="Invoice Line Information" ColumnNumber="2">

 

<FormTableItemStyle Wrap="False" Width="100%"></FormTableItemStyle>

 

<FormCaptionStyle CssClass="EditFormHeader" Width="100%"></FormCaptionStyle>

 

<FormMainTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="3" BackColor="White"

 

Width="100%" />

 

<FormTableStyle CellSpacing="0" CellPadding="2" CssClass="module" Height="110px"

 

BackColor="White" />

 

<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>

 

<PopUpSettings Modal="true" Width="600" />

 

</EditFormSettings>

 

</MasterTableView>

 

<ValidationSettings CommandsToValidate="PerformInsert,Update" />
 
//client javascript

function

OnGridCommand(sender, eventArgs)

{

 

if(eventArgs.get_commandName() == "Edit" || eventArgs.get_commandName() == "InitInsert" )

{

 

if (!Page_ClientValidate()) return false;

}

 

 

}

//server event

 

protected void gridInvLines_ItemCommand(object source, GridCommandEventArgs e)

{

 

switch (e.CommandName)

{

 

case RadGrid.InitInsertCommandName:

e.Canceled =

true;

 

//this is for the Calendar Date control

System.Collections.Specialized.

ListDictionary newValues = new System.Collections.Specialized.ListDictionary();

 

if(radBillPeriodStartDate.SelectedDate.HasValue)

newValues[

"BEGIN_BILLING_PERIOD"] = Convert.ToDateTime(radBillPeriodStartDate.SelectedDate);

 

if(radBillPeriodEndDate.SelectedDate.HasValue)

newValues[

"END_BILLING_PERIOD"] = Convert.ToDateTime(radBillPeriodEndDate.SelectedDate);

e.Item.OwnerTableView.InsertItem(newValues);

 

 

 

break;

 

default:

 

break;

}

}

 

 
 
 
Sebastian
Telerik team
 answered on 28 Apr 2010
1 answer
140 views
Hi

I see in severals posts how to configure RadCaptcha in IIS 7.0 adding the next lines to the web.config.

<httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd"type="Telerik.Web.UI.WebResourceSession" verb="*" validate="false" />
</httpHandlers>
    
<handlers>
     <add name="Telerik_Web_UI_WebResource_axd" verb="*"preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd"type="Telerik.Web.UI.WebResourceSession" />
</handlers>

I had IIS 6.0 and the reserved word <handlers> doesn´t exist, so, what lines I need to add to the web.config?

Thanks




Pero
Telerik team
 answered on 28 Apr 2010
1 answer
76 views
I have the Telerik grid with custom rows to appear and disappear using:

    for (int i = 0; i < RadGridMain.MasterTableView.Items.Count; i++)
        {
            if (masterCL.Contains(int.Parse(RadGridMain.MasterTableView.DataKeyValues[i]["MasterChecklistID"].ToString())))
            {
                RadGridMain.MasterTableView.Items[i].Visible = false;
                RadGridMain.MasterTableView.Items[i].Enabled = false;
                RadGridMain0.MasterTableView.Items[i].Visible = true;
                flag = false;

            }
            else
            {
                RadGridMain.MasterTableView.Items[i].Visible = true;
                RadGridMain0.MasterTableView.Items[i].Visible = false;

            }

        }
Some of the columns in RadGridMain will invisble based on the method above. However, when I click on the Add new record to add new item. The invisible columns are visible again... how can I make it still invisible when clicking on Add new record button?

Thanks
Princy
Top achievements
Rank 2
 answered on 28 Apr 2010
1 answer
51 views
inserting image don't work on Internet Explorer 8 bug in page and image insert dialog not functional.
In FireFox is working.
Rumen
Telerik team
 answered on 28 Apr 2010
1 answer
429 views
Hi,

i have two radcombobox on my page..
          <telerik:RadComboBox ID="cboSourceFund" runat="server"
                            DataSourceID="SourceFundDataSource" DataTextField="AFIMSFundCode" DataValueField="AFIMSFundCode" 
                            Width="55px" Skin="Outlook" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged1" SelectedValue='<%# Bind("SourceAfimsFund") %>'
                            BorderWidth="1px">
                       </telerik:RadComboBox>                        
                       
                        <telerik:RadComboBox ID="cboSourceFundHidden" runat="server"
                            DataTextField="AFIMSFundCode" DataValueField="BaseCurrencyCode" 
                             style="display:none;">
                       </telerik:RadComboBox> 

i have one javascript function

function GetCurrency(value) {

    var cboSourceFundHidden = document.getElementById("ctl00_messagePanelsContent_contentPlaceHolder_fvAllotmentDetail_cboSourceFundHidden");

    for (index1 = 0; index1 < cboSourceFundHidden.options.length; index1++) {
        alert("22");
        if (cboSourceFundHidden.options[index1].value == value) {
            return value;
            break;
        }

    }    
  
}

and this function is called from here

function OnClientSelectedIndexChanged1(item)
 {
var currency = GetCurrency(item._value);
}

but the above code is not working and i am not getting count in 
alert(cboSourceFundHidden.options.length);
its giving nothing while dropdown object is present
alert(cboSourceFundHidden);

please help.

thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 28 Apr 2010
1 answer
98 views
Hi all.
I have a code
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"  
            GridLines="None" onitemdatabound="RadGrid1_ItemDataBound"
            <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
                <Columns> 
                    <telerik:GridTemplateColumn> 
                        <FooterTemplate> 
                            <telerik:RadComboBox ID="RadComboBox1" runat="server"
                                <ItemTemplate> 
                                    <telerik:RadGrid ID="RadGrid2" runat="server"
                                    </telerik:RadGrid> 
                                </ItemTemplate> 
                            </telerik:RadComboBox> 
                        </FooterTemplate> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
            ConnectionString="<%$ ConnectionStrings:XConnectionString %>"  
            SelectCommand="SELECT [Name] FROM [Projects]"></asp:SqlDataSource> 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridFooterItem) 
        { 
            GridFooterItem footer = (GridFooterItem)e.Item; 
            RadComboBox combo = ((RadComboBox)footer.FindControl("RadComboBox1")); 
            RadGrid grid = ((RadGrid)combo.Items[0].FindControl("RadGrid2")); //result is null
            //RadGrid grid = ((RadGrid)combo.FindControl("RadGrid2")); //result is null

            string r = "fF"
        } 
    } 

The question is how can I get reference to RadGrid2?

Shinu
Top achievements
Rank 2
 answered on 28 Apr 2010
1 answer
116 views
I have a control (A) which has ModalPopUpExtender which again opens a new control (B). The AsyncUpload control is hosted on control B. When i select the file, the file never gets uploaded.

Can any one help.

Regards
Nitesh Gaba
Top achievements
Rank 1
 answered on 28 Apr 2010
1 answer
100 views
Hi,

I am using the TreeView control with checkboxes, with 2 levels of nodes. I like the tri-state for the checkboxes. The list I have is short and I'd like the treeview to always be expanded - I want to hide the plus image to the left of the top node to prevent the user from collapsing any of the top level nodes. How can I do this? Seems like it should be easy to do, but I can't find the property to set.

Thanks,

Jason
Shinu
Top achievements
Rank 2
 answered on 28 Apr 2010
0 answers
162 views
Hi,

I am using a RadEditor with an ImageManager.  In the ImageManager I want users to be able to upload images, but not delete, rename or create new folders.

I have managed to disable deleting and creating new folders, but I can't work out how to disable renaming.  Can anyone suggest how this can be done?

Thanks
Andrew

Edit:  I worked it out.  See this thread for those who are interested http://www.telerik.com/community/forums/aspnet-ajax/editor/prevent-users-from-deleting-folders.aspx

Andrew Dixon
Top achievements
Rank 1
 asked on 28 Apr 2010
3 answers
114 views
Hi,

we are using Telerik product and Assembly  version
Product - 2009.02.0616.35
Assembly  2009.2.616.35

we use the below piece of code for exporting to excel from grid.But in the output, we face a empty row between the header and data rows in excel sheet.we don't want that empty row.

In one of the forums post they said to add this code RadGrid1.MasterTableView.AllowFilteringByColumn = false;
but still we dont have luck on that

 

void btnExcel_Click(object sender, ImageClickEventArgs e)

 

{

 

 

LRG RadGridToExport = this.Page.FindControl(RadGridIDToExport) as LRG;

 

 

if (RadGridToExport == null) return;

 

 

if (RadGridToExport.Items.Count > 0)

 {

RadGridToExport.ExportSettings.ExportOnlyData = 

true;

 

 

RadGridToExport.ExportSettings.IgnorePaging = chkAll.Checked;

RadGridToExport.ExportSettings.OpenInNewWindow = 

true;

 

RadGridToExport.MasterTableView.ExportToExcel();

}

}

Daniel
Telerik team
 answered on 27 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?