Forms Data Controls :: How To Make Some Words Of A Cell In Gridview Bold Type
Aug 16, 2010
I'd like to make some words of a cell in gridview Bold. For example - "MRN No.: SI0021848 Name: Cherry" like my attachment. I could query this field value from database but don't know how to make some words Bold. How to do it?
View 2 Replies
Similar Messages:
Jan 16, 2010
How to make gridview row in bold? I've written the below code to do that but I get error
Error2 Cannot implicitly convert type 'int' to 'bool'
my code is
protected void ddlread_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (GridViewRow row in GridView1.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
if (((CheckBox)row.Cells[0].FindControl("chkselect")).Checked == true)
{
if (ddlread.SelectedIndex = 1)
{
//GridView1.RowStyle.Font.Bold.ToString();
row.Font.Bold.ToString();
}
else
{
}
}
}
}
}
View 2 Replies
Mar 25, 2010
I have a gridview control having 4 columns. one of the column is of type linkcolumn. user has to enters data for each column.
How can we edit link column cell. if i click on this cell nothing happen.i set its readonly to false also.
View 5 Replies
Feb 7, 2011
I have a GridView. I am trying to make an Array or ArrayList of type structure. The vales that I want to make the ArrayList or Array (I don't know which one is more appropriate) from are points with latitude and longitude and are of type float. I have:
Point[] Array = new
Point[counter];
foreach (GridViewRow row
in GridView1.Rows)
{......
View 9 Replies
Oct 27, 2010
im just trying to use this answer, but im getting an error on my page:
"A field or property with the name 'returnantID' was not found on the selected data source."
Im not really sure what the "returnantID" is but it appears my page isn't liking it, not sure if i was sopposed to cswap it out for some other data or not.
This is my current gridview:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None"
DataSourceID="ObjectDataSource1">
<Columns>
<asp:BoundField DataField="ProductName" HeaderText="ProductName"
SortExpression="ProductName" />
<asp:BoundField DataField="Price" DataFormatString="{0:c2}" HeaderText="Price"
SortExpression="Price" />
<asp:BoundField DataField="Length" HeaderText="Length"
SortExpression="Length" />
<asp:BoundField DataField="Engine" HeaderText="Engine"
SortExpression="Engine" />
<asp:BoundField DataField="Colour" HeaderText="Colour"
SortExpression="Colour" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
</Columns>
</asp:GridView>
would just like the ProductName to link to the corresponding products page(using its Id)
p.s this is what i tried:
<asp:HyperLinkField DataNavigateUrlFields="returnantID" DataNavigateUrlFormatString="Details.aspx?id={0}" DataTextField="ProductName" NavigateUrl="Details.aspx" />
**Update** I changed the "returnantID" to "ProductName" which turned the name of my product into a link but clicking that link gave me this new error:
Input string was not in a correct format.
View 5 Replies
Jul 15, 2010
me how can i make each cell of a gridview selectable(Web Project)?
Basically my requirement is to do some action when i select a cell without having postback. And I am not allowed to use ajax or jquery here. how can i do this using only asp.net gridview and javascript(possibly).
For Example, i want to make some control visible/invisible or enable/disable based on the cell selected.
View 3 Replies
Aug 3, 2010
I generate dynamic grids based on a count value returned from some DB tables. the code for it goes like this : I give and Id to each grid that is generated.
if (myDataList1.Count >= 1)
{
for (int i = 0; i < myDataList1.Count; i++)
{
//retrieving the exact i count from pageload
ViewState.Add("newCount", i);
//creating the dynamic grid with its corresponding gridview properties.
grvDynamic = new GridView();
grvDynamic.ID = "GridView" + (i+3);
grvDynamic.AutoGenerateColumns = false;
grvDynamic.RowCreated += GridViewRowCreated;
grvDynamic.RowDataBound += grvDynamic_RowDataBound;
//adding bound field columns to retrieve data from stored proc
BoundField metric = new BoundField();
metric.HeaderText = "Goal ";
metric.DataField = "metric";
grvDynamic.Columns.Add(metric);
BoundField mtd = new BoundField();
mtd.HeaderText = "MTD";
mtd.DataField = "value_MTD";
grvDynamic.Columns.Add(mtd);
BoundField goal = new BoundField();
goal.HeaderText = "Tier Level Achieved";
goal.DataField = "value_goal";
goal.HeaderStyle.Width = Unit.Percentage(10);
grvDynamic.Columns.Add(goal);
BoundField you1 = new BoundField();
you1.HeaderText = "Month End";
you1.DataField = "firstLevel_you";
grvDynamic.Columns.Add(you1);
BoundField you2 = new BoundField();
you2.HeaderText = "Month End";
you2.DataField = "secondLevel_you";
grvDynamic.Columns.Add(you2);
ButtonField singleClick = new ButtonField();
singleClick.CommandName = "clickHyperlink";
singleClick.Visible = false;
grvDynamic.Columns.Add(singleClick);
BoundField metricId = new BoundField();
metricId.HeaderText = "Metric Id";
metricId.DataField = "metricID";
metricId.Visible = true;
grvDynamic.Columns.Add(metricId);
//binding the gridview to data.
grvDynamic.DataSource = data;
grvDynamic.DataBind();
grvDynamic.Columns[5].Visible = false;
}
}
protected void grvDynamic_RowDataBound(object sender, GridViewRowEventArgs e)
{
//this basically gets the metric Id's of rows with the ishyperlink flag set to 'Y'. I need to make these particular cells clickable var isClickable = (from md in myDataList3 where md.IsHyperLinkFlag == 'Y' &&
md.value_MTD != null select md.metricID).ToList();
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Get reference to button field in the gridview.
LinkButton _singleClickButton = (LinkButton)e.Row.Cells[5].Controls[0];
if (isClickable.Contains(Convert.ToInt32(e.Row.Cells[6].Text)))
{
e.Row.Cells[1].Style["cursor"] = "hand";
e.Row.Cells[1].Style["color"] = "blue";
e.Row.Cells[1].Style["textdecoration"] = "Underline";
e.Row.Cells[1].Attributes.Add("onClick", "window.location ='../HeaderPages/page2.aspx' ");
}
}
}
This code works perfectly fine , depending on the ishyperlink flag in the database...specific cells in the grid are made clickable and then redirected to page2.aspx My Issue: I need to capture which specific cell in which specific grid the user has clicked. store some information in sessions based on the cell clicked and use that information in page2.aspx.
View 5 Replies
Apr 24, 2014
I want to know how to make textbox.text bold , i have to send that to mail how to make that below is my code
"Dear " + txtname.Text + "
" + "Thank you for your registration" + "
" + "Your Log in Id is " + txtemail.Text + "
" + "Your Password is " + txtpassword.Text +
I have to make txtemail.text bold when that is received through email by the user
View 1 Replies
Mar 4, 2011
No sense in showing a competely blank column. how to make a GridView column invisible if every cell in that column is empty?
View 3 Replies
Nov 17, 2010
I have a pretty basic search feature on a site that queries a sqldb with a sqldarasource, and then displays the results on a page, in a panel within a Repeater. I'd like to figure out if it's possible to somehow highlight the words the user searched on as they are displayed in the search results. The code below is my repeater. Do you know of any way to manipulate the Title or Description if the words in it's body match the words searched?
<asp:Panel
ID="pnlExperience"
runat="server"
Height="500px"
ScrollBars="Auto">
[code]...
View 1 Replies
Apr 30, 2010
I have a grid view populated with some data included bit fields and I made an export to excel function For each row i need to check the cell with the bit value to change the cell color, but the cell is always empty, even if is the field is set to False or True. foreach (GridViewRow row in gv.Rows)
View 2 Replies
Feb 11, 2010
I'm having a weird problem where the GridView cell that I'm programmatically updating turns grey, and throws a null error when attempting to save row. I have been searching all day and have not been able to find a solution. I'm guessing there is a problem with my code, so here it is:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
View 5 Replies
Jan 10, 2010
I want to created a messaging system and to display the messages. I want to use a gridview. My problem is how can I display the new messages in BOLD rows and the readed messages in normal text.
View 7 Replies
Jun 25, 2010
I have a gridview control having the following columns.
ContestantID
Public Votes
Judges Votes
Public Percentage
Total
Schedular ID
Formula
4
200
1
51.282
330
2
130
3
190
2
48.718
450
2
260
2
1
??
25
1
1
??
1
3
??
75
3
1
??
On the basis of SchedularID i want to compare the value in column total and make the one with higher value as bold. But the problem is i am calculate the Total column at run time inside Row databound even. So any solutions?
[Code]....
View 6 Replies
Oct 28, 2010
I want to save the contents from HtmlEditor(Ajax Control) into a database field.
If i try to save as VARCHAR than error comes as data too long.
View 1 Replies
Nov 18, 2010
I have a listvieiw with url's in some of the cells. When I click on them they do nothing. I formated the cells to be "hyperlinks" but still nothing.
View 8 Replies
Oct 3, 2010
I would like to know why somethimes DefaultValue in properties window is displayed in bold text and somethimes in normal weight text? What i know is that the Value in Properties Window should display bold only if the Value is different than DefaultValue.
So i have a situation, where i need to set DefaultValue's and i'm successfully setting the boolean Value but failing in Integer value...
aspx:
[Code]....
Now the reason why i'm using Int32 in this example is that i hovered the mouse over the DefaultValue and it's said that "represents a 32-bit signed integer" but still no luck.
Why is my StepHour displayed bold and how to display this DefaultValue in regular weight text?
View 7 Replies
Jul 22, 2010
how to make "particular text bold" in c#.net.While am wrting my output in html form.
View 4 Replies
Sep 10, 2012
i have linkbutton in my page i want when users go on text of linkbutton with mouse, linkbutton's text be bold.
how i can do it?
View 1 Replies
May 27, 2010
I have been stuck on an issue that is driving me mad and I bet its simple. I have a Textbox with a gridview and a LINQ statement in code behind that populates the data source of the gridview at page load.
The Textbox is used as a filter for the where clause in the Linq statement. All works as expected however I want to be able to use more than one word as a filter. This is the problem. I take the textbox string and convert to an array
Dim aryTextFile() As String = SearchString.Split(",")
But I need to figure how to pass the values of the array as parameters for the Linq Statement. I need to return all rows that have either a match for LocationName AND/OR Address AND/OR City. I thought of something like this but it fails.
Dim db As New DCLocationsDataContext
Dim q = From t In db.Locations _
Where t.City AndAlso t.LocationName AndAlso t.Address Like aryTextFile _
Select t
GridView1.DataSource = q
GridView1.DataBind()
View 6 Replies
Dec 28, 2010
I like to use GridView because it is easy and flexible to work with. However, I found it quite frustration when it comes to display a column with a large chuck of words into the value of that particular column. Is there anyway to restrict how many words should only be display in a particular column rather than let it expands to cope up to display all the word. For example, I'm trying to display 20w and normally it would display
wwwwwwwwwwwwwwwwwww
but I would like to limit to 5 words in a line so it's going to be
wwwww
wwwww
wwwww
wwwww
View 6 Replies
Oct 13, 2013
I have TextBox and two button in insert.aspx page
1-BtnBold
2-BtnInsert
I want when I enter text in textbox and select Words from textbox and click on BtnBold it Bold selected word and when I click on BtnInsert it insert Textbox's Text in database with that format..I want do something Like Ckeditor
View 1 Replies
Aug 24, 2010
I have a textbox and a gridview which is bound to a table what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;
1. Book
2. Red
I have set up the sql data source and everything and my like operator is this.
LIKE '%' + @record + '%'
how can I solve this problem?
View 3 Replies
Apr 2, 2010
I am having problem with rowdatabound, want to add if conditions intact, i am using teh following two if conditions and they don't look right. i found them on google.
If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then end if
If e.Row.RowState = DataControlRowState.Edit Or e.Row.RowState = 5 Then end if
With datagrids i use these and they work excellent:
If e.Item.ItemType = System.Web.UI.WebControls.ListItemType.Item OrElse e.Item.ItemType = System.Web.UI.WebControls.ListItemType.AlternatingItem Then
end if.....
View 2 Replies
Oct 4, 2010
I am sending email using C#.NET, for which I am using System.Net.Mail.MailMessage class. I want to make a portion of the email's subject bold. Is there any way to do it?
View 2 Replies