|
I have a gridview with autogeneratecolumn false.I have bind it with a data table dt.In dt there is a column named as "status" whose data type i bit.that means status can take either 0 or1.in gridview this column shows true or false.
I want to show "Read" and "Unread" for 0,1 respectively.
How can I do???
plz..help...
|
|
|
|
|
In GridView1_RowDataBound(),
try this,
if (e.Row.Cells[1].Text == "0")
{
e.Row.Cells[1].Text = "Read";
}
|
|
|
|
|
Use the GridView RowDataBound Event Delegate to change the value of one cell.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
e.Row.Cells[0].Text = e.Row.Cells[0].Text == "0" ? "Unread" : "Read";<br />
}
Happy Coding...
|
|
|
|
|
You can also use case in query at time of retrieving data from database :-
For Example:-
case status when '0' then 'Unread' else 'Read' end as status
|
|
|
|
|
hiii
i m using asp.net
and facing problem in edit time,when i click on edit button all field are readonly they are not change in textbox(editable mode).
code is
<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3"
GridLines="Horizontal" DataKeyNames="materialrecipt_no" PageSize="20"
Style="position: relative" Width="1064px"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
OnRowEditing="GridView1_RowEditing" AllowPaging="True">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True"
ForeColor="#F7F7F7" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C"
HorizontalAlign="Right" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True"
ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="materialrecipt_no"
HeaderText="Sr No" InsertVisible="False"
ReadOnly="True" SortExpression="materialrecipt_no" />
<asp:BoundField DataField="materialrecipt_date"
HeaderText="Entry Date"
SortExpression="materialrecipt_date" />
<asp:BoundField DataField="pname" HeaderText="Product
Name" SortExpression="pname" />
<asp:BoundField DataField="qty" HeaderText="Quantity"
SortExpression="qty" />
<asp:BoundField DataField="enterby" HeaderText="Enter By"
SortExpression="enterby" />
<asp:BoundField DataField="sno_to" HeaderText="Sr
No(End)" SortExpression="sno_to" />
<asp:BoundField DataField="sno_from" HeaderText="Sr
No(Start)" SortExpression="sno_from" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:mcplConnectionString2 %>"
SelectCommand="SELECT * FROM [mat_in] ORDER BY
[materialrecipt_no] DESC"
UpdateCommand="Update [mat_in] set
[pname]=@pname,[qty]=@qty,[enterby]=@enterby,[sno_to]=@sno_to,[sno_from]=@sno_from
where [materialrecipt_no]=@materialrecipt_no"
></asp:SqlDataSource>
|
|
|
|
|
Post you server code also
|
|
|
|
|
Hi all,
i have deployed a site where a i am reading the username using User.Identity.Name.Remove(0, User.Identity.Name.IndexOf("\") + 1) and then validate this username in active directory. if exist proceed. Locally it is working well however when iam deploying iam disabling anonymous and checking only windows integrated security the first time i input the url a username and password is popping.
What i need is not to pop up this message and directly enter the site if validated.
Any sugesstions, thanks
|
|
|
|
|
Apperently, you also have Basic Authentication enabled. You need to disable it.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks for ur reply.
No iam only enabling windows integrated and the popup msg is only showing the first time i enter the application URL.
|
|
|
|
|
Hi,
any body worked on ibm language ware,if worked pls suggest
how to integrate sql server to ibm language ware,it uses derby instead i want to integrate it to sql server..
pavithramukesh
|
|
|
|
|
pavithramukesh wrote: any body worked on ibm language ware,if worked pls suggest
What does it has do with ASP.Net?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
i need use that with my .net project
|
|
|
|
|
Can we show the big size[200 MB] Video in the Web Site?. if it , can we show in the embeded control or is there any other control or easy technic for this.
|
|
|
|
|
Ofcourse you can! I don't know the length of the video, visitors of your website have to download the 200 MB of video to view the entire video. If the video is long enough to download the 200 Mb while playing you're fine, else the video will stop playing when the buffer is empty and start buffering the next part of the video. You may consider if this is actually what you want, you're going to use loads of bandwith when your website has a lot of visitors.
For embedding, try silverlight! I even managed to create my own video player with silverlight. If I can do it... You can
|
|
|
|
|
This is an around one hour video. what is silverlight, can i get some sample codes or helping links?
|
|
|
|
|
Can anybody help me
i am developing an online examination system
i want to display Questions one by one
how i can use move next,move previous,move last,move first
|
|
|
|
|
when you design the table, assign a unique number for each question (example: question no.). Say that, you are showing 15th question and the user wants to move to previous.
Now you have to show the 14th question. You can do it easily. Use session if you need.
|
|
|
|
|
Hi
When you select the rows from table sorted by some order let's say sorting by name you can ranking for selected rows and then get the rows where between 1 and 14
This sample query may help you:
DECLARE @PageIndex int = 1,
DECLARE @PageSize int = 14
SELECT * FROM
(
-- selecting the rows sorted by name
SELECT Row_NUMBER() OVER (ORDER BY Name DESC) AS Row,
Q.*
FROM Questions_Table Q
)
AS questions
WHERE Row BETWEEN CONVERT(nvarchar(10), ((@PageIndex - 1) * @PageSize + 1)) AND
CONVERT(nvarchar(10),@PageIndex*@PageSize)
Hope that helps
--
http://ashakthi.blogspot.com
http://kids-articles.blogspot.com
|
|
|
|
|
Hi, I downloaded .net framework 3.5 setup from microsoft site and installed it on my vista home premium.
But even after successful installation I am not able to see the framework installed anywhere on my system.
I cannot see it even in the programs folder or in the programs menu. I am not able to see the .net command prompt.
Is there anything missing in my installation. Please help!!
|
|
|
|
|
the default installation folder of .NET framework is in "[OS Drive]:\WINDOWS\Microsoft.NET\Framework"
regards...
|
|
|
|
|
You can also see it in Control Panel->Add Remove Programs.
or type 'Microsoft.Net' in Start->Run. And then open the folder Framework->v3.5.
Alternatively you can use the sample program downloadble from the following link to identify the .NET Framework version in your system.
http://msdn.microsoft.com/en-us/library/ydh6b3yb(VS.85).aspx[^]
|
|
|
|
|
Thanks .. I can work now !!
|
|
|
|
|
find some sample and test it, you will get to know and it will create the following folder [windows Root Dir]%Microsoft.NET%Framework%v3.5.
Check this ...!
|
|
|
|
|
|