C# - Truncate Text In RadGrid Column?

Jan 19, 2010

using Telerik RadGrid* in a LINQ context, with ASP.NET/C#, how to truncate text to a maximum length when displaying in columns? By maximum, I mean if original string's length is shorter than the specified maximum length, no errors will raise.I have seen many examples of this on the net, but it seems that the Container.DataItem used to achieve this is different when using LINQ. Sometimes we see DataItem as a method, sometimes not. Examples are usually using a DataSet.Here's an example found (source) :

<asp:TemplateField HeaderText="Description">
<ItemTemplate>
<%# ValidateString(Container.DataItem("Description")) %>

[code]...

View 2 Replies


Similar Messages:

Web Forms :: Truncate Long Text In Label?

May 14, 2012

I have  lable in my Datalist and I bind it from Database this lable fill with my Product description

I want when description be longer than my datalist width it go to second line i mean show my lable in 2 line after that if again longer than 2 line it show with"..." like this (second row)

Mega Mall

In this Mall we have many store that  In this MallIn this MallIn this MallIn this Mall...

Image

i use this code in my SP for showing"... " (substring([Description],0,40)+'...'  As Description)

but i dont know how i can set for my lable that break my text 2 line?

View 1 Replies

Web Forms :: Truncate Long Text In Label In DataList?

May 4, 2012

i have datalist in my page and I have a table in my Data base that keep some Discription about product i bind this discription to my datalist my data list width is 150PX but my description that i bind from my database are  long that can not getting there  i want my description text show in my datalist like this :

EX:

Mega Mall

In this Mall we have many store that …

Image

see second row this is description row that i bind i want in this row show my text and if my text be longer than my datalist width it doesnt show the continue of my text it show this  (...)

View 1 Replies

Data Controls :: How To Get Sum Of Column Value In Radgrid Footer

Apr 27, 2016

i want to display a sum of column values in radgrid footer.

View 1 Replies

C# - RadGrid Column Editable On Insert But Set To Readonly On Update?

Nov 6, 2010

I have a RadGrid which has a column like:

<telerik:GridTemplateColumn HeaderText="Car" >
<ItemTemplate>
<asp:Label ID="MakeLabel" runat="Server" Text='<%# Eval("Make") %> />
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="MakeTextBox" runat="Server" Text='<%# Bind("Make") %> />
</EditItemTemplate>
</telerik:GridTemplateColumn >

and I'm wanting to set it up so that this column will allow input when inserting new values but won't when updating values.

View 2 Replies

C# - Extra Column Appearing When Paging In Telerik RadGrid?

Oct 5, 2010

I'm getting a blank column when switching to another page using the default pager in the telerik radgrid. As data for each row, it shows the type of data i am using for the rows (SearchRecord)

Anyone have any clues as to why this may be happening? It doesn't show up on initial population of the grid, but only when I do paging. My columns are built dynamically but i confirmed that when my columns are built, they are the correct number.

View 1 Replies

Column In DataView Not Rendering When Databound To DataGrid (or RadGrid)?

Sep 7, 2010

Using ASP.NET Web Forms.I am databinding a DataView to a DataGrid with AutoGenerateColumns set to trueThe final column of the DataView is not rendering.Using the debugger I can see that the column definitely exists in the data grid's datasource. The column is of type decimal and some of the rows in the column have data in them.The column has a column name.The other columns are rendering fine.What's going on?Some more infoFunnily enough, I can set AutoGenerateColumns to false, then just add the columns manually:

datagrid.Columns.Clear();
foreach(DataColumn column in dataView.Table.Columns)
{
datagrid.Columns.Add(new BoundColumn {
HeaderText = column.ColumnName });
}
datagrid.DataSource = dataView;

This works fine. Why can't .NET do this with AutoGenerateColumns?

View 1 Replies

Best Practice To Manage Telerik RadGrid Grid And Column Widths?

May 25, 2010

I wanted to ask what is the best practice to manage width of the radGrid.

For my application most users are running 1280 x 1024 so I would be happy to set my overall grid width to 1100. However, depending on the form in use, I sometimes have horizantal scroll bars. To solve this, I have been playing with the width of the grid, and also I have played with setting the itemstyle-width for one or two columns. Sometimes I accidentally get it right, and sometimes it is not quite right.

What is the best way to manage this? Do I set the grid, and then all columns, or just the grid, or just the columns? I guess there is a best practice, so just wondering how you handle it,

View 2 Replies

Using Telerik RadGrid - How To Set The Date Format For Autogenerated Column In Edit Mode

May 23, 2010

Using VS2008, and Telerik radGrid version 2010.1.519.35

I have a about 50 DNN modules using telerik radgrid and I need to display my dates in dd/mm/yy format. It is possible to do this easily in view mode, but when I switch to edit mode, it is more of a struggle. I can write a snippit of code to reformat the displayed date values to dd/mm/yy, but for inserts the user must enter mm/dd/yy.

IOW, I need to change the culture of the form to en-GB culture.

In my DotnetNuke App, I have made a change to the web.config, but it still assumes en-US format.

I am not sure whether I need to set this at web.config level, page level or at the column within the control.

View 3 Replies

Forms Data Controls :: Showing Image In One Column In Radgrid Using Values From Database?

Jan 19, 2010

I am having one column in each row of my radgrid in which i want to show an image. I am getting values from database saying 1,2 for that particular column and for each of these values i want to show different images for different values. For Example if i am getting 1 from database i want to show "roseImage" and for 2 i want to show "lotusimage",

View 3 Replies

Controls :: Change Radgrid Header Text When Checked Change With JavaScript

Nov 20, 2012

i have radgrid in my asp.net web page with some columns and rows in each row i have some checkbox that they are in one column. so i have one checkbox in each row and column.

i want when the check box checked, write in header that checkbox(in that column) write the number and so in that row, write the diffrent number. i want it occure client-side.

View 1 Replies

Forms Data Controls :: Display Text In 2 Rows And Then A Gridview Column - Third Row Is Displayed As A Row Under First Column

Jul 14, 2010

I have a gridview with 3 columns. In second column I want to display some text in 2 rows and then a gridview.
Here is my code:

[Code]....

The problem is my third row is displayed as a row under first column. How do I make it a separate column in my girdview. Not sure what is going wrong.

View 11 Replies

Web Forms :: Set Text Box Height According To (table Column) Text

Jul 2, 2010

I have a multiline text box on page which has style "overflow: hidden" to hide the scroll bar. I want to set the vertical hight of that text box at runtime according to the string coming from table column. Is there any way of doing it? I have tried to put the text in array but its not working....

Dim myParas As Object
myParas = Split(TextBox2.Text, vbNewLine)
ln = UBound(myParas) + 1
TextBox2.Height = 22 * ln

View 4 Replies

SQL Reporting :: Wrap Text In A Column Text Box

Jul 13, 2010

I am having a table in rdlc that displays the data from a dataset. My problem is the value of one of the fields is long contineous string because of which my report is getting expanded horizontally. i want to wrap the text in this field so that it occupies fixed width of column & gets wrapped. I cant manipulate the text as i have to export the report to PDF.

View 3 Replies

SQL Server :: Truncate URL While Displaying Data?

Dec 3, 2010

I have a column([URL]) in my Table ([Titles]) it has url's with different lengths, I want to display the URL (only till start of the query string ) in Gridview from this column

Eg: www.asp.net?thisis%test.cid -- is the original one in DB and i want output to be like

www.asp.net ( only till the ?). I know how to do this via C# code but I am drawing blank on how to do this in a query or Stored Proc.

it has url's with different lengths, I want to display the URL (only till start of the query string ) in Gridview from this column

View 8 Replies

Web Forms :: Attempting To Truncate Fields In A GridView?

Jan 25, 2010

I have been trying to figure this out and can't... I have seen this code used before but for some reason it will not work in this situation. I have a GridView and I want to truncate cells where the field length is greater than 18 characters and then show the entire contents in a tool tip. The tool tip works fine but I can't get the field contents to truncate. When I run in debugger the tc.text always shows as . but when the page renders there is content in these cells, content over 18 characters. The code never errors out it just never sees the contents as anything but "" and therefore never truncates the field contents.

[Code]....

View 5 Replies

Mobiles :: To Truncate Existing Website For Use With Devices

Feb 7, 2010

I would like to truncate my existing website for use with mobile devices specifically the iphone. how might I accomplish this? Are there MS tools or methodolgies for truncating my site without building a new website from scratch?

View 2 Replies

DataSource Controls :: Use Transaction To Work With Truncate And Sqlbulkcopy?

Apr 30, 2010

I code to exec a store procedre (sp_truncate) to truncate 10tables and using sqlBulkCopy to download a huge data. Both them are working fine.Now I want to use transaction with application (not in store procedure) torollback truncate tables if download is failed.Is it possible to use transaction to work with these two steps?

View 1 Replies

DataSource Controls :: How To Truncate A String In A Database Table

Jun 14, 2010

I get an error when I try to update a row in an SQL database table with a string of fewer characters than were previously stored. I attempted to correct this problem by using the "PadRight" function in my C# webpage event handler to fill in the remaining characters with spaces, but I don't seem to be able to make that work. So, what do I do when I want to store fewer characters in a table row that has more characters previously stored in it?

View 2 Replies

DataSource Controls :: Deleting Top 500 Rows With Truncate Statement?

Jun 1, 2010

I have table with 1000 rows. is it possible to delete top 500 rows with truncate statement ??

View 2 Replies

Crystal Reports :: Ho To Get 3 Decimal Digit From A Float Value Using Truncate Function

Mar 1, 2011

I want to display a number to words. for eg : RO 70.357 should display as "Seventy Rials and three hundred fifty seven baiza" because in Oman currency is of 3 decimal digits.

My question is below

When I used truncate function to get the decimal value it returning with 2 decimal digits. eg: 70.36 (357 is rounded to 36)

I want to display exact digits without rounding a decimal value.

View 1 Replies

Web Forms :: Truncate Or Strip Long String Into Limited Characters In Repeater

Apr 20, 2013

I want to show limited text in a linkbutton which is inside repeater control.. As repeater is configure with datasource...how can i do that...

View 1 Replies

Show A Text Value In A Column In Gridview In .net?

Jan 29, 2011

I have a GridView to show user detail like name,phone,and status(active,suspend).my problem is that in database the user status in from of integer like 1 for Active and 0 for suspend.now while i am showing data to user in GridView I want to show Active and suspend Text according to status in database 1 or 0. I am not getting where to check for this condition in Asp.Net I am new in asp. I have done it in php also.like

if($fetch->user_status==1)
echo "Active"
else
echo "suspend"

View 2 Replies

C# - Wrap Text In Boundfield Column In Gridview

Oct 27, 2010

i am having a boundfield column and in that column if i entered a string(without spaces) of length 15, there is no problem. But if the string is more than 15, the text is not wrapped. I gave the command column.ItemStyle.Wrap=true; But its not working. I have fixed the width of the column. How to wrap the text in the boundfield if a string more 15 characters.

View 3 Replies

ADO.NET :: SQL Column Values To Display In Text Boxes

Aug 13, 2010

I am hoping this is not a silly question but I have been struggling to find an answer. I have created a web application to insert data into SQL database using T_SQL and stored procedures as I needed to update several tables at the same time. The design of a particular page is using text boxes and dropdown list's and not the default gridviews or details view as I wanted the page structure set out in a particular way. Anyways I now want to create an update page which I will get redirected to from a search page.My question is how do I assign the column values to text boxes or Dropdown lists from my Select statement. I was thinking of having a event in the page load method. Sort of like this 'Select InvoiceID, Invoicetype, Notes FROM TblInvoice Where Invoicenumber = @Invoicenumber " the parameter value @Invoicenumber will be assigned via the search page so I will also need to pull that in on the page load event. So my page would look something like this if say the:-

Textbox1 = InvoiceID(Value)
DropDownnlist1 = Invoicetype(Value)
Textbox2 = Notes(Value)

how to write this in a code behind page. I would then click a button to update the values if I changed them and write my update statement for the button click event which I know how to do .

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved