|
Can you provide me an example please if you dont mind?
Thanks,
|
|
|
|
|
Hi.
I have this updatepanel, with some fields that are getting filled from an ObjectDataSource.
One of the fiels are a date, and i want this date to be marked as red (and maybe in bold) if the date is one day from today or later.
Problem is, I have no clue on how to do this, since I am new to asp.net!
So is there a way to add a method that changes this specific ItemStyle-ForeColor based on the content i get from my datalayer?
This is my updatepanel:
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView Width="1200" ID="gvTasks" runat="server" OnRowCreated="gvTasks_RowCreated"
DataSourceID="odsTaskList" GridLines="None" AutoGenerateColumns="false" CssClass="mGrid"
PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" OnSelectedIndexChanged="GvTasks_SelectedIndexChanged"
DataKeyNames="ID">
<Columns>
<asp:BoundField DataField="Enddate2" HeaderText="Enddate" ItemStyle-ForeColor=RED-IF-OVERDUE-EXCEEDED ItemStyle-HorizontalAlign=Center>
<HeaderStyle Width="80px" HorizontalAlign="Center" />
<asp:BoundField>
<Columns>
<asp:GridView>
<ContentTemplate>
<asp:UpdatePanel>
Thanks alot!
|
|
|
|
|
lvq684 wrote: I have this updatepanel
It does not matter in your case.
lvq684 wrote: i want this date to be marked as red (and maybe in bold) if the date is one day from today or later
You need to use RowDataBound of GridView for this.
protected void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
DataControlRowType rtype = e.Row.RowType;
if (rtype == DataControlRowType.DataRow && rtype != DataControlRowType.Footer
&& rtype != DataControlRowType.Separator && rtype != DataControlRowType.Header
&& rtype != DataControlRowType.Pager)
{
Calendar cd = e.Row.FindControl("myCal") as Calendar;
cd.ForeColor = Color.Red;
}
}
|
|
|
|
|
Thanks alot for your answer, but I dont quite follow the code.
Whats up with the
Calendar cd = e.Row.FindControl("myCal") as Calendar;
And could you please paste the corresponding .aspx code for the Gridview please?
I am very grateful!
|
|
|
|
|
I believe what i have provided is more than enough.
lvq684 wrote: could you please paste the corresponding .aspx code
No! i wouldn't
lvq684 wrote: but I dont quite follow the code
You said you have a calendar inside the grid, so that line gets the calendar control to you.
Looks like you are a fresher. Would suggest you to read book first.
|
|
|
|
|
Yes, as stated in the first post, I am new to asp.net.
It´s not a calendar but a simple string which holds the date. The date sorting is being issued elsewhere. But I´ll try changing the calendar to a string and fiddle with it.
Question is just how the page control calls this method. I will google some more.
Thanks.
|
|
|
|
|
hi, iam using asp.net with c#,
in my page there are many images in top ,left , right,bottom i want to draw verticle line and horizontal lines like this as showed in below example .can you give example which helps me
||
image1 || || image9
|| ||
|| ||
image2 || || image9
|| ||
|| ||
|| ||
image3 || || image10
|| ||
||====================================||
image4 image5 image6 image7 image8
|
|
|
|
|
|
|
Hello all!
I'm new to asp.net and i'm trying to bind some XML data to a gridview.
abviously I'm not understanding how to do it properly because that my code doesn't seem to
work...Can anyone could help me please?
this is my xml:
#########################################
<?xml version "1.0" encoding "utf-8"?>
<dictionary>
<item>
<key>
<string> hello world </string>
</key>
<value> <anytype xmlns:q1="http://www.w3.org/2001/XMLSchame" d4p1:type="q1:int"
xmlns:d4p1="http-instance">45</anytype>
</value>
</item>
</dictionary>
and this is my code:
########################################
string path = "D:\\myXmlFile.xml";
DataSet oDs = new DataSet();
oDs.ReadXml(path);
GridView1.DataSource = oDs;
GridView1.DataBind();
thanks
Tom
|
|
|
|
|
|
There are a lot more forums left. Why not post your question in all of them.
|
|
|
|
|
Hello,
I am looking for a good design pattern that will solve managing Urls in a web application. At this moment, I have a chaos of hard coded url referring in every pages. If I change the page name, I get lost as I dont know how many pages I have to update where I used the url. So, I am assuming, there should be a pattern something named URL Factory etc. Cany you please give me a guidance... !
Another question, does it make any difference in performance if I use absolute URL instead of relative url ? I am thinking of developing a URL factory for my web application and so, if I use Absolute url, it may be easy to manintain my Url factory.
Regards.
|
|
|
|
|
There is no pattern for this, although, the MVC pattern may be able to help since urls are based on actions not actual page names. The application should be sufficiently designed so you are not continuously changing file names.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Mark,
Thanks for your reply. I know that MVC solve this problem, but I actually do not like MVC as I am so much fond of event based programming, moreover, I have already developed a complicated ASP.NET Application based on Web Form, so maybe Model View Presenter would be a solution for this. Can you tell me if there is any standard Model View Presenter framework available for Web Forms ?
|
|
|
|
|
Emran Hussain wrote: I actually do not like MVC as I am so much fond of event based programming
It's not a case of whether you like it or not, or whether you are fond of it or not. The best tools for the work should be the deciding factor. Many projects have failed miserably because managers, architects and developers having only used what they are most familiar with or most comfortable with, not the best solution for the problem.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi Every1,
I have webpage which displays an article and at the end of the same i have a print buttn (Asp:ImageButton).When i click on it ,i want to open a new window with article on it and a print dialogue box for printing..How can i acheive this...
Thanks in Advance,
|
|
|
|
|
I don't understand your question but, if you want to open a new window on image click then
Use ImageButton 'onClientClick' Event.
like
onClientClick="window.open(your page url);"
|
|
|
|
|
|
window.open opens link[^]a new window and window.print link[^] will print your article. It will show the print dialog first.
|
|
|
|
|
Hi,
I Want to Convert my whole site to Hindi...I have two links as Hindi and English...If i click the link as Hindi the whole site should be converted to Hindi and if i click the link as English then the whole site should be changed to English, same as that of this site "http://www.univercell.in/mobiles/populateStore.action". Plz do the needful
Regards,
Kavitha
|
|
|
|
|
No need to post it multiple times. Stick to one and follow it. Remove the other one you had posted before anyone replies to it.
|
|
|
|
|
|
Hi,
Is it possible to convert my site from one language to another in asp.net.. Plz provide sample code or any site for refference...
Regards,
Kavitha
|
|
|
|
|
// Hide rows
grid.Model.RowHeights.SetHidden(2, 100, true);
grid.Model.RowHeights.SetHidden(110, 1000, true);
// Unhide rows
grid.Model.RowHeights.SetHidden(1010, 10000, false);
//Hide columns
grid.Model.ColumnWidths.SetHidden(2, 100, true);
grid.Model.ColumnWidths.SetHidden(110, 150, true);
// Unhide columns
grid.Model.ColumnWidths.SetHidden(1010, 10000, false);
[C#]
//Insert a column at position 2.
grid.Model.InsertColumns(2, 1);
//Insert 2 rows at position 5.
grid.Model.InsertRows(5, 2);
[C#]
grid.Model.Options.ExcelLikeCurrentCell = true;
[C#]
grid.Model.Options.ExcelLikeSelectionFrame = true;
http://help.syncfusion.com/ug_74/GridWPF/defaultWPF.html
http://www.syncfusion.com/support/kb/2153/Opening-Syncfusion-offline-documentation-from-the-Dashboard-in-the-version-81030
http://help.syncfusion.com/ug_74/gridweb/CreatingTemplates.html
|
|
|
|