This is a migrated thread and some comments may be shown as answers.

Skin in RadGrid

12 Answers 289 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jyoti
Top achievements
Rank 1
Jyoti asked on 25 Jul 2008, 10:27 AM
i am using custom skin in gridview
where should i give path of my skin
like in old version their skinpath property
but not finding in new version
how could i set my own skin for gridview

12 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 25 Jul 2008, 12:10 PM
Hello Jyoti,

There is no SkinsPath in the new RadControls for ASP.NET AJAX. In order to use a custom skin for a given control, you need to register the CSS file manually using a <link> tag, or add the skin to an ASP.NET theme, so that it is registered automatically by the framework.

In addition, you have to set EnableEmbeddedSkins="false" for RadGrid and specify the skin name with Skin="..."

You can find more information here:

RadControls for ASP.NET AJAX - Controlling Visual Appearance
RadControls for ASP.NET AJAX - Skin registration

Let us know if you need further advice.


Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jyoti
Top achievements
Rank 1
answered on 28 Jul 2008, 04:30 AM
Hello Dimo

Thanks for your help
Now my grid is showing css as i add css in my master page
But still i am having one problem
Images of my grid is still not showing like it is not showing images of sorting,paging etc. and sometimes it is also showing message of purchase telerik control .

Regards
Jyoti
0
Dimo
Telerik team
answered on 28 Jul 2008, 05:34 AM
Hello Jyoti,

In order to make RadGrid show images when using a custom skin, you should either set the ImagesPath property, or modify the RadGrid skin to use CSS sprites. The first option is a lot easier and recommended for new users of Telerik controls. The ImagesPath property tells RadGrid where its images are located. You only have to make sure that the image names are the ones that RadGrid expects. The image filenames are listed in this help article:

RadGrid Skins

As for the trial message, it will disappear if you purchase and start using a Dev version of Telerik RadControls.


Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jyoti
Top achievements
Rank 1
answered on 28 Jul 2008, 06:16 AM
Hi Dimo

Again thanks and yeah i sort out this problem
One more question to ask that i am getting all images
what should i do if i dont want to display paging images
i just only want to give text to my paging
i am using page mode nextprevnumeric and i dont want images of paging
if i dont set path of images url of paging it will automatically show

<

PagerStyle PrevPageImageUrl="~/Styles/RadSkins/Grid/HrManager\PagingPrev.gif" NextPageImageUrl="~/Styles/RadSkins/Grid/HrManager\PagingNext.gif" FirstPageImageUrl="~/Styles/RadSkins/Grid/HrManager\PagingFirst.gif" LastPageImageUrl="~/Styles/RadSkins/Grid/HrManager\PagingLast.gif"></PagerStyle>


but i dont want this.

Thanks & Regards
Jyoti
0
Accepted
Dimo
Telerik team
answered on 28 Jul 2008, 11:29 AM
Hello Jyoti,

There are several ways to achieve what you want. One of the simplest is to use a CSS rule to hide the images in the pager item:

 
tr.GridPager_Skin img 
        displaynone
 


Best wishes,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jyoti
Top achievements
Rank 1
answered on 28 Jul 2008, 11:35 AM
Hi Dimo

Thanks a lot
Your answer is working.

Regards
Jyoti
0
Jyoti
Top achievements
Rank 1
answered on 30 Jul 2008, 07:45 AM
Hi Dimo

I am using Custom paging and custom sorting
it work fine with old version bt same code is not working with new latest version of  radgrid.So what should i do.When i sort my data and do paging in last page my code will return records but grid is unable to bind the records show message no records found however my code is returning records,Please help ASAP.

Thanks
Jyoti
0
Sebastian
Telerik team
answered on 30 Jul 2008, 07:56 AM
Hi Jyoti,

Do you use the implementation from the following code library thread as a starting point? It should be operational regardless of the version of the grid.

In case the problem seems to be elsewhere, I suggest you isolate a working subset of your project, demonstrating the erroneous behavior, and send it enclosed to a formal support ticket. We will examine it carefully and will get around to you with more info on the subject.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jyoti
Top achievements
Rank 1
answered on 30 Jul 2008, 09:34 AM
Hi  Stephen
 I am giving you code and also sending you query for sorting and paging please review it and see whats the problem

/// <summary>

/// Sort Grid View

/// </summary>

///<param name="sortOrder"></param>

///<param name="sqlSortExpression"></param>

/// <returns></returns>

private void RadGrid_TextListEditor_SortDataBind(string sqlSortExpression, string sortOrder)

{

List<TextList> textList;

// sqlSortExpression += " " + sortExpression;

textList =

TextListBLL.GetTextLists(textListId, RadGrid_TextListEditor.CurrentPageIndex, RadGrid_TextListEditor.PageSize, sqlSortExpression, sortOrder);

RadGrid_TextListEditor.VirtualItemCount =

TextListBLL.GetTextListsCount(textListId);

RadGrid_TextListEditor.DataSource = textList;

RadGrid_TextListEditor.DataBind();

//adGrid_TextListEditor.Rebind();

}

/// <summary>

/// Bind Grid View

/// </summary>

private void RadGrid_TextListEditor_DataBind()

{

List<TextList> textList;

string sqlSortExpression = "";

if (RadGrid_TextListEditor.MasterTableView.SortExpressions.Count != 0)

{

sqlSortExpression = RadGrid_TextListEditor.MasterTableView.SortExpressions[0].ToString();

}

textList =

TextListBLL.GetTextLists(textListId, RadGrid_TextListEditor.CurrentPageIndex, RadGrid_TextListEditor.PageSize, sqlSortExpression,"");

RadGrid_TextListEditor.VirtualItemCount =

TextListBLL.GetTextListsCount(textListId);

RadGrid_TextListEditor.DataSource = textList;

RadGrid_TextListEditor.DataBind();

//RadGrid_TextListEditor.Rebind();

}



/// <summary>

/// Grid View Paging

/// </summary>

protected void RadGrid_TextListEditor_PageIndexChanged(object source, GridPageChangedEventArgs e)

{

RadGrid_TextListEditor.CurrentPageIndex = e.NewPageIndex;

RadGrid_TextListEditor_DataBind();

}

/// <summary>

/// Grid View Sort Command,Sorting

/// </summary>

/// <returns></returns>

protected void RadGrid_TextListEditor_SortCommand(object source, GridSortCommandEventArgs e)

{

string sortExpression = "";

if (RadGrid_TextListEditor.MasterTableView.SortExpressions.Count == 1)

{

switch (RadGrid_TextListEditor.MasterTableView.SortExpressions[0].SortOrder)

{

case GridSortOrder.Ascending:

sortExpression =

"DESC";

break;

case GridSortOrder.Descending:

sortExpression =

"ASC";

break;

}

}

RadGrid_TextListEditor_SortDataBind(e.SortExpression,sortExpression.ToString());

}



string query = @"

WITH TextList AS

(

SELECT

ROW_NUMBER() OVER (ORDER BY "

+ sortExpression + @") AS RowNumber,

tl.*

FROM

(

SELECT dt.Id,

dt.Alias,sl.Culture AS Language,dt.Text,dt.SystemLanguageId

FROM

DocGen_Texts dt

LEFT OUTER JOIN

Core_SystemLanguages sl

ON dt.SystemLanguageId=sl.Id

WHERE dt.TextListId=@Id

) tl

)"

;

string pagingClause = " SELECT * FROM TextList WHERE RowNumber BETWEEN ((@CurrentPageIndex * @PageSize)+1) AND ((@CurrentPageIndex * @PageSize) + @PageSize)";

string queryPaged = query + pagingClause;

0
Sebastian
Telerik team
answered on 01 Aug 2008, 08:43 AM
Hello Jyoti,

From your code snippets I see that you are using simple data-binding with DataBind() calls for your grid. I suggest you switch to advanced binding through the NeedDataSource event of the control to see whether this helps.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jyoti
Top achievements
Rank 1
answered on 12 Aug 2008, 01:23 PM
Hi,
I want that Insert mode of radgrid is enabled when my grid is binded.
it means it is always in inline insert mode.Please help how it will done.

Thanks & Regards
Jyoti Khurana
0
Konstantin Petkov
Telerik team
answered on 15 Aug 2008, 07:45 AM
Hi Jyoti,

You can achieve that through the Grid_PreRender event setting the table IsItemInserted to true and rebinding the Grid:

    protected void RadGrid1_PreRender(object sender, System.EventArgs e) 
    { 
        RadGrid1.MasterTableView.IsItemInserted = true
        RadGrid1.Rebind(); 
    }  


All the best,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Jyoti
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Jyoti
Top achievements
Rank 1
Sebastian
Telerik team
Konstantin Petkov
Telerik team
Share this question
or