making radgrid filters case insensitive
GroupingSettings-CaseSensitive="false"
Achievement provides the only real pleasure in life
GroupingSettings-CaseSensitive="false"
Posted by
SF
at
5:22 pm
0
comments
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ABC")) == "Text To Be Found")
e.Row.Visible = false;
}
}
Posted by
SF
at
3:11 pm
0
comments
RadGrid1.MasterTableView.Columns.FindByUniqueName("ABC").Visible = false;
Posted by
SF
at
3:13 pm
0
comments
my code that has problem sorting template columns:
the instruction says "the SortExpression value should match the data field you want to sort on (typically the field a control in the template is bound to)". I made sure this rule is applied but the problem remained. Then I removed the HeaderTemplate components, instead I added value to HeaderText property in the GridTemplateColumn level. This solved the problem, not sure why though.....
the new code looks like:
...........
.......
Posted by
SF
at
2:11 pm
0
comments
protected void ABC_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e){if (e.CommandName == "PerformInsert"){//make sure the insert user control closes automatically after insertede.Item.OwnerTableView.IsItemInserted = false;}}
Posted by
SF
at
2:06 pm
0
comments
* Delete the .designer.cs file
* convert the .aspx or ascx file into a webapplication by right clicking on it
Posted by
SF
at
5:45 pm
0
comments
Checked=' < % # DataBinder.Eval( Container, "DataItem.Active" ) % >'
Posted by
SF
at
4:22 pm
0
comments
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName)
{
//enter the code here
}
}
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditFormInsertItem && RadGrid1.MasterTableView.IsItemInserted)
{
GridEditFormInsertItem insertItem = (GridEditFormInsertItem)e.Item;
(insertItem["abc"].Controls[0] as TextBox).Text = "hello world";
}
}
Posted by
SF
at
9:23 am
0
comments
my web.config has multiple connection strings.
when I right click on a table adapter in a dataset in design view, select "configure...", the dataset configuration window pops up. Naturally you'd just make the changes that you want to the query and click on Finish. If this table adapter doesn't use the first connection string listed in the web.config, visual studio will automatically change the connection string to the first one listed in the web.config.
In order to fix the problem when you first open up the configuration window click on Previous to go back to the connection string selection view, RESELECT the connection string. If you happened to encounter this error until this stage right click on the empty area of the dataset design view and select View Code. Then delete the unused connection string.
Posted by
SF
at
11:23 am
1 comments
when i tried to enter ipconfig in cmd mode it says: not valid command.
the solution is: right click on the cmd program and select "run as administrator".
why couldn't Vista run my programs as administrator when i logged in as administrator? this is stupid!
Posted by
SF
at
8:51 am
0
comments
found this tool very useful
http://www.mobchoice.com.au/compare-cap-plans-spreadsheet
Posted by
SF
at
9:42 am
0
comments
see below my code. every "\n" works fine except the ones after "Event: {0}" and "Start Date: {1:D}", basically the Event, Start Date and End Date are printed on same line. can anyone help please? thanks in advance.
string.Format(
"Schedule Details: \n" +
"Event: {0}\n"+
"Start Date: {1:D} \n" +
"End Date: {2:D} \n" +
"Location: {3} \n"
,schedule.event,
schedule.startDate,
schedule.endDate,
schedule.location);
I tried ""Event: {0}"+ Environment.NewLine" and "Event: {0}\r" and "Event: {0}/r/n" got the same result
==============
Schedule Details:
Event: Basketball Match Start Date: Friday, 1 May 2009 End Date: Tuesday, 30 June 2009
Location: Como
================
Then I tried "Event: {0}\n"+ Environment.NewLine" and "Event: {0}\r"+ Environment.NewLine" and "Event: {0}/n/r" got this result (an additional line)
==============
Schedule Details:
Event: Basketball Match
Start Date: Friday, 1 May 2009 End Date: Tuesday, 30 June 2009
Location: Como
================
It seems that it works either for no newline or 2 new lines, but not for 1 newline. I tried to take out "Event" everything else worked just fine, so the problem must be with "Event"?
The Event has datatype of "string", startDate and endDate are datetime, location is string. A sample of Event value is "Attend Class Certificate III in Basketball".
Eventually the problem is solved, not sure why though.....:
I put single quotes around the Event value, not sure how exactly but it worked.
"Event: '{0}'\n"+
Posted by
SF
at
2:10 pm
0
comments
Labels: ASP.NET), new line, partially works (C#, string.format
foreach(datarow in the query result)
{
ListItem currentCheckBox = CheckBoxListABC.Items.FindByValue(datarow ["TheFieldName"].ToString());
if (currentCheckBox != null)
{
currentCheckBox.Selected = true;
}
}
Posted by
SF
at
9:14 am
0
comments
Labels: ASP.NET, checkboxlist, databinding, select
using System.Globalization;
..
..
..
..
..
string ManipulatedString= CultureInfo.CurrentCulture.TextInfo.ToTitleCase("OriginalString");
Posted by
SF
at
5:34 pm
0
comments
Labels: ASP.NET, C#, capitalize first letter, titlecase
in my case PageA has a buttonA that opens PageB. The code is "response.redirect("PageB.aspx");"
on PageB I have some methodM to call under condition "if (!IsPostBack)"
After I clicked on ButtoA to open PageB, methodM is trigerred.
but when I use the PREVIOUS button on Internet Explore to go back to PageA and click on NEXT button to go back to PageB the methodM didn't fire.
How can I catch the Previous and Next button click event?
the answer is adding the code below into Page_Load in the target page, this line of code will force the target page to load from server instead of cache
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Posted by
SF
at
1:00 am
0
comments
Labels: button, IE, ispostback, load from server, next, previous, stop cache
http://www.asp.net/learn/data-access/tutorial-01-cs.aspx
Posted by
SF
at
8:04 pm
0
comments
Labels: asp.net 2.0, data access, vs2005 express
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
return clientIPAddress;
Posted by
SF
at
7:10 pm
0
comments
Labels: 2.0, ASP.NET, C#, retrieve IP
without parameter: LIKE '%abc%'
with parameter: LIKE '%'+@searchString+'%'
Posted by
SF
at
3:53 pm
0
comments
Labels: keyword search, LIKE, MSSQL, operator, parameter
found these links quite useful:
http://blogs.msdn.com/webdevtools/archive/2008/02/09/downloadable-hotfix-performance-and-editor-fixes-for-microsoft-visual-studio-2008-and-visual-web-developer-express-2008.aspx
https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826
Posted by
SF
at
5:01 pm
0
comments