|
Create TemplateField in GridView and add checkbox control.
Check this link.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
thank u for replying me .
sorry if i am not clear ... The scenario is
i am having a fields in a data base (table)
ID Name Section
1 XX A
2 YY B
3 ZZ C
. . .
. . .
. . .
. . .
so in gird i have to display columns like
Sno XX YY ZZ
the grid columns should be Generate dynamically with check boxes as i shown above plz help me
thank u
|
|
|
|
|
can you please more clarify your requirement....as you want to display XX , YY , ZZ horizontally?? what is the purpose to display like this....and after display you have to select or not....which event you have to fire???
|
|
|
|
|
Actually the "XX,YY,ZZ..." are the user name. so the user name are not fixed its dynamic it may increase or decrease .... so this names should display horizontally as a header with check box columns in the grid...
the main purposes is that giving authorization to a user for a particular area...
ex
Sno XX YY ZZ
1 _
2
3
if the user checks at xx at 1st position (ie '-') that he can access page "1"........
am i clear to explain u?
thank u
|
|
|
|
|
Here I will suggest you to use DataView or Repeater Control rather that GridView. Or use XSLT to render data on page, depends on requirments.
This is for your Reference
Check It
Hope this will help you
Thanks
|
|
|
|
|
Ok....
you mean to say
abc.ASPX User_1 User_2 User_3 User_4
xyz.ASPX User_1 User_2 User_3 User_4
pqr.ASPX User_1 User_2 User_3 User_4
So if you select User_1, user_2 for abc.ASPX than this two user can see abc.ASPX
To implement this one with help of Gridview is to much lengthy process and time taking...because after selecting you have to store this data to Database....
also While binding this grid view if user have already rights for this page at that time u have to make them check at first time of page load.
Ao at time of saving you have to check whether user have already rights or not.
Better solution is to use two list box First listbox contain all page name and second Listbox contain all the use name....after secting page name on selected index change event u can fatch all the records from the DB for users....and on click of submit you can easily identify this one.
|
|
|
|
|
Veera anil wrote: add check box column to grid view dynamicly..
This will be done by Template Field in Grid View
|
|
|
|
|
thank u for replying me
sorry if i am not clear ... The scenario is
i am having a fields in a data base (table)
ID Name Section
1 XX A
2 YY B
3 ZZ C
. . .
. . .
. . .
. . .
so in gird i have to display columns like
Sno XX YY ZZ
the grid columns should be Generate dynamically with check boxes as i shown above plz help me
thank u
|
|
|
|
|
Please check my reply over here
|
|
|
|
|
How to set focus for each item in a list box.
|
|
|
|
|
Do you mean this?
ListBox1.ItemIndex = 1;
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
anu_anu wrote: How to set focus for each item in a list box.
This will focus on the Listbox Directly,
ListBox1.Focus();
If you want to focus on particular ListBox item,
public void FocusItem(int index)
{
ListBox1.SelectedIndex =index;
}
Hope this will help you
|
|
|
|
|
Hello,
I am developping ASP.NET 2008. My data is stored in SQL server 2008.
The problem is when I query, I got 0 records and this is because the data is stored in hebrew.
I tried to change the collation property in Column of the table but it doesn't help
Please help
Shay Noy
|
|
|
|
|
Don't you think this question would be better asked in the database forum?
only two letters away from being an asset
|
|
|
|
|
Ok thanks, I didn't know that there was database forum
Shay Noy
|
|
|
|
|
|
|
Dear all,
Im trying to write my first asp.net webservice in c#.
this webservie has a public methode that returns a streamreader.
When calling this methode from my client side:
testWebservice.Service1 serv = new WebApplication1.testWebservice.Service1();
StreamReader r = serv.CheckAccount(TextBox1.Text, TextBox2.Text);
i get this error:
Error 1 Cannot implicitly convert type 'WebApplication1.testWebservice.StreamReader' to 'System.IO.StreamReader'
What is wrong here and how can i fix this?
thanks
|
|
|
|
|
Piya B wrote: Error 1 Cannot implicitly convert type 'WebApplication1.testWebservice.StreamReader' to 'System.IO.StreamReader'
Error message is clear enough. Even if you clear this error, StreamReader can't be serialized and you can't use it with web services.
|
|
|
|
|
Hi Navaneeth,
What should i have to use instead of StreamReader? i have to return a soap message to the client.
Thanks.
|
|
|
|
|
Hard to tell without knowing much about the problem you are trying to solve. What are you expecting by returning a StreamReader ? Are you trying to send contents of a file?
|
|
|
|
|
No not the content of a file.
Im getting soap envelopes from the server back through my webservice and i have to send this xml to the client that uses my service.
StreamReader HttpSOAPRequest(String xmlfile, string proxy)
{
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\Inetpub\wwwroot\ASP.NET\" +xmlfile);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://uddi.microsoft.com/inquire");
if (proxy != null) req.Proxy = new WebProxy(proxy,true);
req.Headers.Add("SOAPAction","\"\"");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
return r;
}
modified on Tuesday, August 4, 2009 2:19 PM
|
|
|
|
|
hi,
This code is working for me. but the grid cells take too many height and width (Cellspacing&Cellpadding). how can i reduce the space between teh cells content.
<asp:GridView ID="grdResult" runat="server" AutoGenerateColumns="False" OnRowDataBound="grdResult_RowDataBound" CellPadding="0" CellSpacing="0">
<Columns>
<asp:TemplateField HeaderText="PharmacyID" ConvertEmptyStringToNull="false">
<ItemTemplate>
<pre> <asp:LinkButton ID="lnkPatientID" runat="server" Text='<%#Eval("PharmacyID") %>'
CommandName="PharmacyName" CommandArgument='<%#Eval("PharmacyID" )%>'></asp:LinkButton></pre>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NABP" ConvertEmptyStringToNull="false">
<ItemTemplate>
<pre><asp:LinkButton ID="lnkNABP" runat="server" Text='<%#Eval("NABP") %>' CommandName="PharmacyName"
CommandArgument='<%#Eval("PharmacyID") %>'></asp:LinkButton></pre>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Storename" ConvertEmptyStringToNull="false">
<ItemTemplate>
<pre><asp:LinkButton ID="lnkStorename" runat="server" Text='<%#Eval("Storename")%>' CommandArgument='<%#Eval("PharmacyID") %>'
CommandName="PharmacyName"></asp:LinkButton></pre>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address1" ConvertEmptyStringToNull="false">
<ItemTemplate>
<pre><asp:LinkButton ID="lnkAddress1" runat="server" Text='<%#Eval("Address1")%>' CommandName="PharmacyName"
CommandArgument='<%#Eval("PharmacyID") %>'></asp:LinkButton></pre>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="City" ConvertEmptyStringToNull="false">
<ItemTemplate>
<pre><asp:LinkButton ID="lnkCity" runat="server" Text='<%#Eval("City") %>' CommandArgument='<%#Eval("PharmacyID")%>'
CommandName="PharmacyName"></asp:LinkButton></pre>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="NPI" ConvertEmptyStringToNull="false">
<ItemTemplate>
<pre><asp:LinkButton ID="lnkNPI" runat="server" Text='<%#Eval("NPI") %>' CommandName="PharmacyName"
CommandArgument='<%#Eval("PharmacyID") %>'></asp:LinkButton></pre>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#FDF3A5" BorderColor="#C9C7B3" />
<RowStyle Font-Names="Verdana" Font-Size="11px" />
<PagerStyle HorizontalAlign="Right" />
</asp:GridView>
modified on Tuesday, August 4, 2009 10:54 AM
|
|
|
|
|
Well.. this is not the simplle check if Session == null.
In a global.asax file I log in a table the sessionID of a user. In the Session_End i add to that logline the date the session expired. well that works!
But if a user chooses to close the browser in stead of logging out of an application....The additional logline with date session expiration is not saved.
In an overview page I see that according to the database some sessions are days old while the session timeout is set for 2 hours.
When I retrieve the data from the database is it possible to check with the IIS server if the found SessionID in the database is still valid for IIS?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|