Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
268 views
I have a RadButton on a user control.   When I run the site in the debugger, and click the button, it doesn't even cause a postback, because the Page_Init event doesn't fire.    I have even set AutoPostBack="true" and CausesValidation="false" to bypass those possible explanations.

Here is my Radbutton code:

 

 

<telerik:RadButton ID="ReturnButton" runat="server" Text="Return To Test" OnClick="ReturnButton_Click"

 CausesValidation="false" Skin="Telerik" CssClass="rbClearButton" Width="175px" AutoPostBack="true" >  

<Icon PrimaryIconCssClass="rbPrevious" PrimaryIconLeft="4" PrimaryIconTop="4"/> 
 </telerik:RadButton>

When I view source, here is is the HTML that is generated:

<a id="TestModuleDetails_ReturnButton" class="RadButton RadButton_Telerik rbSkinnedButton rbClearButton" href="javascript:void(0)" style="display:inline-block;width:175px;"><!-- 2011.3.1305.35 --><span class="rbPrimaryIcon rbPrevious" style="top:4px;left:4px;"></span><input class="rbDecorated rbPrimary" type="submit" name="TestModuleDetails$ReturnButton_input" id="TestModuleDetails_ReturnButton_input" value="Return To Test" style="width:100%;padding-left:0;padding-right:0;padding-left:4px;" /><input id="TestModuleDetails_ReturnButton_ClientState" name="TestModuleDetails_ReturnButton_ClientState" type="hidden" /></a>


I don't see why it doesn't cause postback, anybody see what I'm missing?

 

Danail Vasilev
Telerik team
 answered on 17 Apr 2013
3 answers
257 views
Hi,

I have a user control that contains a RadGrid and a RadToolBar control. The RadGrid uses the NeedDataSource event to populate its content. The RadToolBar contains a button that inits a postback to save the contents of the page (the page contains other controls such as drop down list , text box, etc. but none are related to the issue I am having). In its current state (code shown below) everything works fine (the RadToolBar ButtonClick event handler get called and the content on the page is saved). The problem occurs when I add an event handler for the RadGrid's ItemDataBound event. I use this handler to set the PostBackUrl of an Button control (I do it on this event because I need the ID of the RadGrid's row content). The problem is that the RadToolBar ButtonClick event handler doesn't get called anymore.

With everything working, the event sequence is: Load -> NeedDataSource -> ButtonClick. After adding the ItemDataBound event the sequence is Load -> NeedDataSource -> ItemDataBound (the ButtonClick event gets "ignored").

Why does adding the ItemDataBound event in the RadGrid affect the ButtonClick event in the RadToolBar? How can I get the ButtonClick event to "not be ignored" while still maintaining the ItemDataBound event?

Thanks. (Please see code below)


When Things Work Fine:

 

<telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="Web20" style="width:100%;" OnButtonClick="RadToolBar1_ButtonClick">
    <Items>
        <telerik:RadToolBarButton ImageUrl="~/[path_omitted]/SaveRadToolBar1.png" Text="Save" ToolTip="Save" />
    </Items>
</telerik:RadToolBar>


 

 

 

<telerik:RadGrid   
ID="RadGrid1"   
runat="server"  
Skin="Vista"  
AutoGenerateColumns="false"  
OnNeedDataSource="RadGrid1_NeedDataSource">
  
    <MasterTableView CommandItemDisplay="None" Height="30" DataKeyNames="ID" ClientDataKeyNames="ID" GroupLoadMode="Client" NoMasterRecordsText="You do not have any data">
        <GroupByExpressions
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="Topic.Category.Name" />
                </GroupByFields>
  
                <SelectFields>
                      <telerik:GridGroupByField FieldName="Topic.Category.Name" HeaderText="Category" />
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
  
        <Columns>
  
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="DataID" Visible="false" />
  
            <telerik:GridBoundColumn DataField="Topic.ID" UniqueName="DataTopicID" Visible="false" />
  
            <telerik:GridBoundColumn DataField="Topic.Category.Name" HeaderText="Name" UniqueName="DataCategoryName" Visible="false" />
  
            <telerik:GridBoundColumn DataField="Topic.Name" HeaderText="Topic" UniqueName="DataTopicName" />
  
            <telerik:GridTemplateColumn HeaderText="Go" UniqueName="DataGoTo" HeaderStyle-Width="50">
  
                <ItemTemplate>
  
                    <asp:Button ID="ButtonGoTo" runat="server" ToolTip="Go to data" Text="Go" />
  
                </ItemTemplate>
  
            </telerik:GridTemplateColumn>
  
        </Columns>
  
    </MasterTableView>
  
</telerik:RadGrid>


When the RadToolBar ButtonClick Event Gets Ignored:


<telerik:RadGrid 
ID="RadGrid1" 
runat="server"
Skin="Vista"
AutoGenerateColumns="false"
OnNeedDataSource="RadGrid1_NeedDataSource" 
OnItemDataBound="RadGrid1_ItemDataBound">
  
    <MasterTableView CommandItemDisplay="None" Height="30" DataKeyNames="ID" ClientDataKeyNames="ID" GroupLoadMode="Client" NoMasterRecordsText="You do not have any data">
  
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="Topic.Category.Name" />
                </GroupByFields>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="Topic.Category.Name" HeaderText="Category" />
                </SelectFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
  
        <Columns  
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="DataID" Visible="false" />
            <telerik:GridBoundColumn DataField="Topic.ID" UniqueName="DataTopicID" Visible="false" />
            <telerik:GridBoundColumn DataField="Topic.Category.Name" HeaderText="Name" UniqueName="DataCategoryName" Visible="false" />
            <telerik:GridBoundColumn DataField="Topic.Name" HeaderText="Topic" UniqueName="DataTopicName" />
            <telerik:GridTemplateColumn HeaderText="Go" UniqueName="DataGoTo" HeaderStyle-Width="50">
                <ItemTemplate>
                    <asp:Button ID="ButtonGoTo" runat="server" ToolTip="Go to data" Text="Go" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
  
    </MasterTableView>
  
</telerik:RadGrid>

 

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = e.Item as GridDataItem;
        (dataItem["DataGoTo"].FindControl("ButtonGoTo") as Button)
            .PostBackUrl = String.Format(
                "~/ShowData.aspx?id={0}",
                dataItem["DataTopicID"].Text);
    }
}

Maria Ilieva
Telerik team
 answered on 17 Apr 2013
1 answer
130 views
So I have pretty strange issue with the paging control of one of my grids. It will almost always be at the bottom of their screen, but for some reason when the page is built, and the relative radgrid IS at the lowest visible element, the dropdown would not expand up instead of down. So I followed another post I found on here to do this:

protected void UploadReportGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
            // there is an issue with the paging RadComboBox drop down direction in the uploaded reports grid.
            // it apparently cannot determine that it is at the bottom of the screen like normal so we make
            // the drop down expand up hard coded.
            if (e.Item is GridPagerItem)
            {
                GridPagerItem pagerItem = e.Item as GridPagerItem;
                RadComboBox combo = pagerItem.FindControl("PageSizeComboBox") as RadComboBox;
                combo.EnableScreenBoundaryDetection = false;
                combo.ExpandDirection = RadComboBoxExpandDirection.Up;
                combo.DropDownCssClass = "UploadReportGrid_PagerDropDown";
            }
        }

This seemed to work, but then the dropdown height was 0, with only its borders rendering above the clickable area of the paging control. So then I used my little CssClass and wrote:

div.UploadReportGrid_PagerDropDown .rcbScroll {
    height: auto !important;
}

This seemed to do the trick, but the height is still rendering at 0 pixels in ie8, and I am assuming for ie7 also. I need to get this to work for both IE7 and IE8. The attached screenshot is IE8. Thats also what it looked like in modern browsers before the CssRule took affect, but doesn't seem to work for IE7 and 8.
Eyup
Telerik team
 answered on 17 Apr 2013
9 answers
509 views
i have RadGrid in userControl of a Content page and when export radgrid data to excel, in exel file , have row with "No child records to display." . find some comment for solve this in internet like use below code :
       protected void WBSRadGrid_PreRender(object sender, EventArgs e)
        {
            WBSRadGrid.MasterTableView.Items[0].Expanded = true;

            if (isExport)
            {
                foreach (GridItem item in WBSRadGrid.MasterTableView.Items)
                {
                    if (item.Expanded)
                    {
                        GridDataItem dItem = item as GridDataItem;
                        GridItem[] items = dItem.ChildItem.NestedTableViews[0].GetItems(GridItemType.NoRecordsItem);
                        if (items.Length > 0)
                        {
                            items[0].Visible = false;

                        }
                    }
                }

            }
        } 
but this not work correctly at all.
what should i do for solve this problem?
please help me.

best regards,
zohreh
Kostadin
Telerik team
 answered on 17 Apr 2013
3 answers
115 views
Hi,
I want to show RadContextMenu only when user Right Click on GridHyperLinkColumn column.

How do i do that?
Eyup
Telerik team
 answered on 17 Apr 2013
3 answers
279 views
Is there a way to stream a file to the response object using an ajaxified button?
Daniel
Telerik team
 answered on 17 Apr 2013
3 answers
302 views
RadDateTimePicker shows the whole date and time.
What I want to do is to only show day of week (Sunday-Saturday) and time.

Is this possible?
Eyup
Telerik team
 answered on 17 Apr 2013
14 answers
258 views
SOS!
I suddenly bumped into weird problem. When I click export button (pdf, excel) on my grid - I am getting this:



Everything works properly in other browsers and in IE9...

Ralf
Top achievements
Rank 1
 answered on 17 Apr 2013
1 answer
129 views
Hello

I am working on radtreeview control. I am new to telerik controls
I am having a problem, see if you guys can help me on it.

I am trying to set default static root for the categories, I have database table name called categories, has iID and iParent columns that make relation of parent and child. 

I want to achieve treeview like this.

Root
|-child1
|-child2
|-child3
   |-child3a
   |-child3b
|-child4
|-child5
|-child6

but i am gettign all child1 to child 6 at root line including root.

here is the code

            SqlConnection conn = new SqlConnection(Global.SQLConnectionString);
            conn.Open();

            string sqlString;
            //sqlString = "SELECT * FROM [MediaLibraryCategories]";
            sqlString = "Select iID,Title,iParent From Categories Union All Select '0','root', -1 Order By Sort";

            SqlCommand Cmd = new SqlCommand(sqlString, conn);
            try
            {
                SqlDataReader Dr = Cmd.ExecuteReader();

                RadTreeView1.DataFieldID = "iID";
                RadTreeView1.DataFieldParentID = "iParent";
                RadTreeView1.DataTextField = "Title";
                RadTreeView1.DataValueField = "iID";

                RadTreeView1.DataSource = Dr;
                RadTreeView1.DataBind();
            }

with Union All, 0  is the iID, root is the title, and -1 is the iParent
other data are like this..

iID, Title, iParent
1    child1  0
2    child2  0
3    child3  0
4    child4  0

5    child5  0

6    child6  0

7   child3a 3
8   child3b 3

Union All

0 Root -1


Thanks,
Kate
Telerik team
 answered on 17 Apr 2013
1 answer
85 views
Hi guys,

We noticed that the client-side clone() method for a SchedulerAppointment does not seem to clone the recurrence rule.

The definition of the function as we see it in your build 2013.1.220.45 is (minified)

clone:function(){var h=new b.SchedulerAppointment();
h._id=this._id;
h._subject=this._subject;
h._description=this._description;
h._start=this._start;
h._end=this._end;
h._toolTip=this._toolTip;
h._internalID=this._internalID;
h._visible=this._visible;
h._recurrenceState=this._recurrenceState;
h._recurrenceParentID=this._recurrenceParentID;
h._contextMenuID=this._contextMenuID;
h._resources=this.get_resources().clone();
h._attributes=this.get_attributes().clone();
if(this.get_reminders){h._reminders=this.get_reminders().clone();
}for(var i in this){if(h[i]===g&&!i.startsWith("_")){h[i]=c(this[i]);
}}return h;
}

I would have expected a line something like:

h.set_recurrenceRule(this.get_recurrenceRule());

Is there a reason why the recurrence rule isn't cloned?

Cheers,
Sam




Plamen
Telerik team
 answered on 17 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?