Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
64 views
I have a reference project code by VB and using telerik .NET UI control. But it have a problem in paging. This is my Employee page, it has been divided into pages but when i click on the other page (eg. 2), the data on table only show data in page 1, i set pagesize 10 is DefaultPageSize (there are 18 items in 2 pages).

   
Public Overrides Sub ViewLoad(ByVal e As System.EventArgs)
       Try
           SetGridFilter(rgEmployee)
           Refresh()
           UpdateControlState()
       Catch ex As Exception
           DisplayException(Me.ViewName, Me.ID, ex)
       End Try
   End Sub
 
   Public Overrides Sub ViewInit(ByVal e As System.EventArgs)
       rgEmployee.AllowCustomPaging = True
       rgEmployee.PageSize = Common.Common.DefaultPageSize
       'rgEmployee.ClientSettings.EnablePostBackOnRowClick = True
       InitControl()
   End Sub
 
   Protected Sub InitControl()
       Try
           Me.ctrlMessageBox.Listener = Me
           Me.MainToolBar = tbarLocations
           Common.Common.BuildToolbar(Me.MainToolBar, ToolbarItem.Create,
                                      ToolbarItem.Edit,ToolbarItem.Save,
                                      ToolbarItem.Cancel)
           CType(MainToolBar.Items(3), RadToolBarButton).CausesValidation = True
           CType(Me.MainToolBar.Items(3), RadToolBarButton).Enabled = False
           CType(Me.MainToolBar.Items(4), RadToolBarButton).Enabled = False
           Me.MainToolBar.OnClientButtonClicking = "OnClientButtonClicking"
           'CType(Me.Page, AjaxPage).AjaxManager.ClientEvents.OnRequestStart = "onRequestStart"
       Catch ex As Exception
           DisplayException(Me.ViewName, Me.ID, ex)
       End Try
   End Sub

in refresh() function call rgEmployee.Rebind() and the html

   
<tlk:RadPane ID="RadPane3" runat="server" Scrolling="None">
           <tlk:RadGrid ID="rgEmployee" runat="server" Height="100%">
               <MasterTableView DataKeyNames="ID" ClientDataKeyNames="CODE, EMP_NAME, EMP_AD">
                   <Columns>
                               <%--<tlk:GridClientSelectColumn> data here --%>
                   </Columns>
               </MasterTableView>
           </tlk:RadGrid>
           <Common:ctrlMessageBox ID="ctrlMessageBox" runat="server" />
            
       </tlk:RadPane>
 
   <script type="text/javascript">
       var enableAjax = true;
    
       function onRequestStart(sender, eventArgs) {
           eventArgs.set_enableAjax(enableAjax);
           enableAjax = true;
       }
   </script>


As i mentioned before, this is a reference project so i refer to the other pages which were paging successful, is different in the "CType(Me.Page, AjaxPage).AjaxManager.ClientEvents.OnRequestStart = "onRequestStart"" call javascript at HTML (slightly silly b/c i really don't know much more about telerik control and this is alse the first time i look at vb code so i can't understand well). I added this code into employee codebehind. It event don't show any things avoid the things from masterpage. Does the problem is there?

When i change rgEmployee.PageSize=20 (don't have "CType(Me.Page, AjaxPage).AjaxManager.ClientEvents.OnRequestStart = "onRequestStart""), it shows all data correctly, and chosing pagesize=10 (were supported by radgrid), it showed correctly too into 10 items for each page (i mean page 2 show 8 items)
Konstantin Dikov
Telerik team
 answered on 25 Oct 2013
4 answers
165 views
I noticed that when the radwindow render mode is lightweight, the default icon in the title bar disappears. If anyone else has seen this issue, the fix is quite easy.

.RadWindow span.rwIcon
{
    background-position: 0 !important;
}

Just an FYI.
Perhaps this can get fixed.
JP
Top achievements
Rank 2
 answered on 25 Oct 2013
1 answer
626 views
Hi,

I've a radlistview and I used its itemDataBound event to attach datakey value to another control to do some staffs.
Previously, my radlistview don't have grouping. But with new requirement, I added grouping to my listview.
Then, I'm getting "Argument out of range exception" when accessing data key value inside ItemDataBound event.
I've reproduced the error and you can see in my sample project below.

This is my Markup File of RadListView.
<telerik:RadListView ID="lvTest" runat="server" attrib="Temp"
    ItemPlaceholderID="ItemPlaceHolder1" AllowPaging="true"
    OnNeedDataSource="lvTest_NeedDataSource"
    OnItemDataBound="lvTest_ItemDataBound"
    GroupAggregatesScope="AllItems"
    DataKeyNames="product_id">
    <ItemTemplate>
        <table style="width:100%;background-color:whitesmoke;border-bottom:1px solid silver;">
            <tr>
                <td style="width:100px">Code:
                </td>
                <td>
                    <%#Eval("Code") %>
                    <asp:Button ID="btnLookup" runat="server" Text="View Details" />
                </td>
            </tr>
            <tr>
                <td>Name:
                </td>
                <td>
                    <%#Eval("Name") %>
                </td>
            </tr>
            <tr>
                <td>Description:
                </td>
                <td>
                    <%#Eval("Desc") %>
                </td>
            </tr>
        </table>
    </ItemTemplate>
    <LayoutTemplate>
        <asp:Panel ID="DataGroupPlaceHolder1" runat="server">
        </asp:Panel>
    </LayoutTemplate>
    <DataGroups>
        <telerik:ListViewDataGroup GroupField="company_name" DataGroupPlaceholderID="DataGroupPlaceHolder1">
            <DataGroupTemplate>
                <table style="border: 1px solid lightgrey; background-color: silver; width:100%;">
                    <tr>
                        <td style="background-color: silver; color: white; font-weight: bold;">
                            <%# (Container as RadListViewDataGroupItem).DataGroupKey %>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Panel runat="server" ID="ItemPlaceHolder1"></asp:Panel>
                        </td>
                    </tr>
                </table>
            </DataGroupTemplate>
            <GroupAggregates>
                <telerik:ListViewDataGroupAggregate Aggregate="Min" DataField="company_id"/>
            </GroupAggregates>
        </telerik:ListViewDataGroup>
    </DataGroups>
    <GroupSeparatorTemplate>
        <div style="background-color: lightgray;height:10px">
        </div>
    </GroupSeparatorTemplate>
</telerik:RadListView>

This is my code behind.
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        lvTest.DataBind();
    }
}
 
protected void lvTest_NeedDataSource(object sender, Telerik.Web.UI.RadListViewNeedDataSourceEventArgs e)
{
    lvTest.DataSource = GetDataTable();
}
 
private object GetDataTable()
{
    DataTable l_Table = new DataTable();
    l_Table.Columns.Add("product_id");
    l_Table.Columns.Add("Code");
    l_Table.Columns.Add("Name");
    l_Table.Columns.Add("Desc");
    l_Table.Columns.Add("company_id");
    l_Table.Columns.Add("company_name");
 
    l_Table.Rows.Add(new string[] { "1", "C001", "Code 001", "Description 001", "1", "Company 1" });
    l_Table.Rows.Add(new string[] { "2", "C002", "Code 002", "Description 002", "1", "Company 1" });
    l_Table.Rows.Add(new string[] { "3", "C003", "Code 003", "Description 003", "1", "Company 1" });
 
    l_Table.Rows.Add(new string[] { "4", "C004", "Code 004", "Description 004", "2", "Company 2" });
    l_Table.Rows.Add(new string[] { "5", "C005", "Code 005", "Description 005", "2", "Company 2" });
    l_Table.Rows.Add(new string[] { "6", "C006", "Code 006", "Description 006", "2", "Company 2" });
    l_Table.Rows.Add(new string[] { "7", "C007", "Code 007", "Description 007", "2", "Company 2" });
    l_Table.Rows.Add(new string[] { "8", "C008", "Code 008", "Description 008", "2", "Company 2" });
 
    l_Table.Rows.Add(new string[] { "9", "C009", "Code 009", "Description 009", "3", "Company 3" });
    l_Table.Rows.Add(new string[] { "10", "C010", "Code 010", "Description 010", "3", "Company 3" });
    l_Table.Rows.Add(new string[] { "11", "C011", "Code 011", "Description 011", "3", "Company 3" });
    l_Table.Rows.Add(new string[] { "12", "C012", "Code 012", "Description 012", "3", "Company 3" });
 
    l_Table.Rows.Add(new string[] { "13", "C013", "Code 013", "Description 013", "4", "Company 4" });
    l_Table.Rows.Add(new string[] { "14", "C014", "Code 014", "Description 014", "4", "Company 4" });
    l_Table.Rows.Add(new string[] { "15", "C015", "Code 015", "Description 015", "4", "Company 4" });
    l_Table.Rows.Add(new string[] { "16", "C016", "Code 016", "Description 016", "4", "Company 4" });
 
    l_Table.Rows.Add(new string[] { "17", "C017", "Code 017", "Description 017", "5", "Company 5" });
 
    l_Table.Rows.Add(new string[] { "18", "C018", "Code 018", "Description 018", "6", "Company 6" });
    l_Table.Rows.Add(new string[] { "19", "C019", "Code 019", "Description 019", "6", "Company 6" });
 
    l_Table.Rows.Add(new string[] { "20", "C020", "Code 020", "Description 020", "7", "Company 7" });
 
    l_Table.Rows.Add(new string[] { "21", "C021", "Code 021", "Description 021", "8", "Company 8" });
    l_Table.Rows.Add(new string[] { "22", "C022", "Code 022", "Description 022", "8", "Company 8" });
    l_Table.Rows.Add(new string[] { "23", "C023", "Code 023", "Description 023", "8", "Company 8" });
    l_Table.Rows.Add(new string[] { "24", "C024", "Code 024", "Description 024", "8", "Company 8" });
 
    return l_Table;
}
 
protected void lvTest_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
{
    try
    {
        if (e.Item is RadListViewDataItem)
        {
            if (e.Item.FindControl("btnLookup") != null)
            {
                try
                {
                    string l_product_ID = (e.Item as RadListViewDataItem).GetDataKeyValue("product_id").ToString();
                    (e.Item.FindControl("btnLookup") as Button).Text = "View: " + l_product_ID;
                }
                catch (Exception)
                {

                }
            }
        }
    }
    catch (Exception ex)
    {
 
    }
}

In this sample project, I change button text with DataKeyValue.
It works only for first two items. Then it throw "argument out of range exception".
I have no idea what's wrong with my code.
You can see it by throwing exception from inner try-catch block.

This is my first time using radlistview with grouping.
So, if there is anything I configured incorrectly, please point me out.
Is data structure OK? (see GetDataTable())

Thanks in advanced, 
Robin

Marin
Telerik team
 answered on 25 Oct 2013
4 answers
1.0K+ views
Hi,

1. Is it Possible to specify Min & Max Columnwidth for column resizing in RadGrid?If possible please me how to do this?
2.In the ViewMode of the grid how to display full numbers as tooltip upon mouseover,Truncated numbers will be identified by three dots at the end(to indicate that there are more digits)?


Regards,
Suneetha
Eyup
Telerik team
 answered on 25 Oct 2013
1 answer
213 views
Hello telerik team,

I am using rad multicolumn combo box. I am binding this combo box using vb code.
I want to add one item saying "New Contact" to it along with the other binded items.
Is it possible?

I have tried using  AppendDataBoundItems="true" property and adding RadComboboxItem through design i.e
 
<telerik:RadComboBoxItem  Text="New Contact" Value="" />

But this is adding an empty row to the combo box, and when I select the empty row, it displays "New Contact" in the combobox.

Please suggest me some solution.

Princy
Top achievements
Rank 2
 answered on 25 Oct 2013
1 answer
122 views

Hello,

I am using the scheduler in timeline view, with resource displayed vertically.

In ie8, the resource cell height is different than the schedule cells height. Please see the attached image.

I am using version 2013.3.1015.40

Please advise, thank you!
Kate
Telerik team
 answered on 25 Oct 2013
1 answer
72 views
Hellow programmers, How can I use a raddatepicker as an year picker? I dont need the day and month.

Please help
Karl
Shinu
Top achievements
Rank 2
 answered on 25 Oct 2013
1 answer
83 views
Hi
I have a radgrid and on the row click.i want that particular column detail.anybody can you please tell me how to get the data of the selected row on row click at clientside.
Princy
Top achievements
Rank 2
 answered on 25 Oct 2013
3 answers
91 views
Hello,

i have a problem regarding load on demand grid combo box
the problem is i want two combo box field  that load grid in one asp.net page

but i am getting error like this

Only one instance of a RadAjaxManager can be added to the page!


i am using two ajax manager.
you can see the example of telerik combox box.i want a two combo box that load data on grid on same page
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridincombobox/defaultcs.aspx?product=grid

please help me out 
i am a beginner in telerik
thanks 

   

Princy
Top achievements
Rank 2
 answered on 25 Oct 2013
2 answers
159 views
Hello,

I have a grid with a thumbnail for each row that now links to the picture of the product. When the user clicks the thumbnail a fancybox shows the picture of the product.

I'm trying to do the same with RadLightBox in the same way, but it seems very complicated to me to bind the RadLightBox component to each picture in the grid. I wonder whether is possible or not to changed the imageURL in the client side when the user clicks the thumbnail.

Blas
Top achievements
Rank 1
 answered on 25 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?