Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
97 views

I've tested with and without a master page, with and without our css file, no difference.


If I specify a width on the grid and the mastertableview, the grid isn't centered on the screen.
If I remove the width on the grid it is centered.
If I set UseStaticHeaders="False" the command template is the same width as the mastertableview and centered.
If I set UseStaticHeaders="True" the command tamplate width is 100% of the screen and the mastertableview is centered.

We've never been able to use HorizontalAlign="Center" becuase we've never seen it work as expected, so we've been wrapping out grids in a <table> to center them. 

Is there something I'm missing?

<telerik:RadGrid ID="RadGrid1" HorizontalAlign="Center" runat="server" AllowPaging="false"
        AllowSorting="True" GridLines="None" BorderWidth="0" PageSize="5" BackColor="White"
        GroupingEnabled="False" CellSpacing="0" Width="750"
        <MasterTableView Name="RepMaster" HorizontalAlign="Center" Width="750" CommandItemDisplay="Top"
            BorderStyle="Solid" BorderWidth="1" BorderColor="Black" TableLayout="Fixed"
            <CommandItemTemplate
                <table border="0" style="width: 100%;"
                    <tr
                        <td align="left" style="width: 125px;"
                            <asp:Button CausesValidation="false" CommandName="InitInsert" runat="server" ID="btnAddNewRecord"
                                Text=" " title="Add new record" CssClass="rgAdd" /> 
                            <asp:LinkButton CausesValidation="false" ID="lnkbAddNewRecord" CommandName="InitInsert"
                                runat="server" CssClass="Link">Add new Record</asp:LinkButton
                        </td
                        <td align="center"
                        </td
                        <td align="right" style="width: 125px;"
                            <asp:Button CausesValidation="false" CommandName="RebindGrid" runat="server" ID="btnRefresh"
                                Text=" " title="Refresh" CssClass="rgRefresh" /> 
                            <asp:LinkButton CausesValidation="false" ID="lnkbRefresh" CommandName="RebindGrid"
                                runat="server" CssClass="Link">Refresh</asp:LinkButton
                        </td
                    </tr
                </table
            </CommandItemTemplate
            <CommandItemStyle BackColor="AliceBlue" Width="500" HorizontalAlign="Center" /> 
            <Columns
                <telerik:GridTemplateColumn UniqueName="RepMasterEdit" HeaderText="Edit"
                    <HeaderStyle HorizontalAlign="Center" /> 
                    <ItemStyle HorizontalAlign="Center" /> 
                    <ItemTemplate
                        <asp:ImageButton ID="imgbEdit" runat="server" CausesValidation="False" CommandName="Select"
                            CssClass="Link" ImageUrl="~/Images/btnEdit.gif" ToolTip="Edit" /> 
                    </ItemTemplate
                </telerik:GridTemplateColumn
            </Columns
        </MasterTableView
        <ClientSettings EnableRowHoverStyle="True"
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting
            <Scrolling AllowScroll="True" ScrollHeight="100%" UseStaticHeaders="true"></Scrolling
            <ClientEvents OnRowDblClick="RowDblClick" /> 
        </ClientSettings
    </telerik:RadGrid>

Private Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
       Dim dt As New DataTable 
       'Add our columns 
       For i As Integer = 0 To 5 
           dt.Columns.Add("Field" + i.ToString, GetType(String)) 
       Next 
       Dim row As DataRow 
       For r As Integer = 0 To 50 
           row = dt.NewRow 
           For c As Integer = 0 To 5 
               row("Field" + c.ToString) = "Value " + r.ToString 
           Next 
           dt.Rows.Add(row) 
       Next 
       Me.RadGrid1.DataSource = dt 
   End Sub
Roger
Top achievements
Rank 1
 answered on 08 Jul 2011
1 answer
89 views
hello,

I have a radgrid with
 GridHyperLinkColumn gridHyperLinkColumn = new GridHyperLinkColumn();
gridHyperLinkColumn.AllowFiltering = true;
 gridHyperLinkColumn.CurrentFilterFunction = GridKnownFunction.Contains;
 gridHyperLinkColumn.ShowFilterIcon = false;
 gridHyperLinkColumn.AutoPostBackOnFilter = true;
But when i tested Filtering Function, the error occurred:
Sys$Enum$parse is not defined
parse()Teleri...98f28bc (line 8060)
b = "Contains"
a = undefined
filter()Teleri...98f28bc (line 7933)
h = "CaseId"
a = "216"
c = "Contains"
f = undefined
(?)()EditCa...seq/326 (line 2)
 
I dont know this error, please help me fix this.
thanks,
hung
Gabor
Top achievements
Rank 1
 answered on 08 Jul 2011
4 answers
143 views
I have some issue putting a datapager to a list box. Following below is my code
<telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListBox1">
 </telerik:RadDataPager>
 
  <telerik:RadListBox ID="RadListBox1" runat="server" AutoPostBack="True"
                                                DataKeyField="EventLocation" DataSourceID="Listbox"
                                                DataTextField="EventLocation" DataValueField="EventLocation"
                                                DlisataKeyField="EventLocation" Skin="Black" allowpaging="true"
                                                style="z-index: 1; left: 1109px; top: 114px; position: absolute; height: 48px; width: 155px; text-align: center;"> <ButtonSettings TransferButtons="All" />
    </telerik:RadListBox>

When i run my aspx page, it doesnt show any paging
Iana Tsolova
Telerik team
 answered on 08 Jul 2011
2 answers
40 views
So the workaround for Upload & AJAX is to do a full postback when the appropriate button is clicked.  So I have this upload, the user browses for the file they're uploading and then click submit.  But instead of just doing a full postback, the webpage never fires any server-side events and returns a bunch of nonsense (see: attached image).

I feel like this is an AJAX response?  But it does do a full-postback it seems...and it doesn't seem to fire any of my events...
Calvin
Top achievements
Rank 1
 answered on 08 Jul 2011
4 answers
204 views

I'm trying to write a workaround for the bug in your RadTabStrip control that prevents tabs from being hidden and displayed on demand.

So instead of building the tabstrip with some tabs hidden, I now add only the tab items I want displayed initially, then use javascript to add further tab items later.

Here's a snippet of the js code...

var tabStrip = $find('myTabStrip');
 
var tab = new Telerik.Web.UI.RadTab();
tab.set_text('text');
tab.set_value('pseudo-id_because_ID_field_is_weirdly_not_supported');
 
var attributes = tab.get_attributes();
attributes.setAttribute("onclick", "alert('hello')");
 
tabStrip.get_tabs().insert(1, tab);

this runs ok and adds a tab to the page, but the attribute is never set, and when I look at the page source it has never been rendered. The items rendered using server side code with the same settings work fine.

Is there something else I should be doing, or is this another bug?

John
Top achievements
Rank 1
 answered on 08 Jul 2011
1 answer
122 views
Hi,
I am not able to find the all day Checkbox Value in  AppointmentInsert Event And also The CustomAttribute textbox also not able to find. Please Help me on this.
Plamen
Telerik team
 answered on 08 Jul 2011
1 answer
89 views
Hi,

I wonder how I can resolve the following issue.

I have tab strip set with attributes:
PerTabScrolling="false"
ScrollChildren="true"
ScrollButtonsPosition="Right"
OnClientLoad="rtsAutoSelectFirstTab"
OnClientTabSelecting="rtsTabSelecting"

        function rtsAutoSelectFirstTab()
        {
            var rts = $find("<%=rts.ClientID%>");
            rts.get_tabs().getTab(0).scrollIntoView();
        }

        function rtsTabSelecting(sender, args)
       {
            //scroll intto visible area selected tab
            args.get_tab().scrollIntoView();
       }


each Tab in a strip has "close tab" image, which removes tab on click. Tab removal is organized on server side and tab strip is getting rebuilt, with 1st tab auto selected.

While all tabs are visible w/o scrolling, no issues are there, however, after I add enough tabs, scroll to the right and start removing them one by one, at some point scroll bar disappears and the leftmost tab disapears from the view or being shown only as a part. Despite having rtsTabSelecting, this leftmost tab is not shown as it should.

any help would be appreciated!

Thanks!
Kate
Telerik team
 answered on 08 Jul 2011
5 answers
104 views
Hi All,

I'm binding my grid with the client-side api.  My data gets populated but by default displays with my ID field in ASC order.  I'd like change this and have it appear in DESC order.  I cannot change the query from the datasource.  I've tried playing around with the mastertableview's fireCommand "sort" but it creates an undesired postback.  There must be a way to do sort on a field right after the initial load.

Thx in advance. 
Tsvetina
Telerik team
 answered on 08 Jul 2011
1 answer
106 views
I have RadGrid inside of the user control which has ViewState turned off. Everything runs fine, including default paging. The problem is that I cannot make custom paging to work because if grid has AllowCustomPaging=true then CurrentPageIndex is always 0 since the container has view state disabled. The grid itself has EnableViewState="true" but it appears that it stores CurrentPageIndex elsewhere.

There is OnPageIndexChanged event which does fire and gives me the next page index, but I cannot use it to store index in the session because this event fires AFTER OnNeedDataSource. I wish there was OnPageIndexChanging event..

How can I make it to work?

-Stan
Tsvetina
Telerik team
 answered on 08 Jul 2011
1 answer
47 views
Hi,
I am trying to localize the contents of the Grid Pager and this is the code i have in the Item Data Bound event handler

if (e.Item is GridPagerItem) //set the appropriate values in the Pager drop down
{
                    GridPagerItem gridPagerItem= e.Item as GridPagerItem;
  
                    Label pageSizeLabel = gridPagerItem.FindControl("ChangePageSizeLabel") as Label;
                    if (null != pageSizeLabel)
                        pageSizeLabel.Text = "Number of Items:";
  
                    GridUsersList.PagerStyle.PagerTextFormat = "{4}{5} " + "items in " + "{1}" + " pages";
                    GridUsersList.PagerStyle.NextPageToolTip = "Next Page";
                    GridUsersList.PagerStyle.PrevPageToolTip = "Previous Page";
                    GridUsersList.PagerStyle.LastPageToolTip = "Last Page";
                    GridUsersList.PagerStyle.FirstPageToolTip = "First Page";
}

This works fine, but i have over 20 grids in different web pages in my application. Is there any way to standardize this instead of making this change in 20 different places?

Ullas
Mira
Telerik team
 answered on 08 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?