|
if your column is 11 in grid view than u need to hide 10 one because in grid column start from 0 as base index
so you code may be
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowState = DataControlRowState.Edit Then
GridView1.Columns(10).Visible = True
ElseIf e.Row.RowState = DataControlRowState.Normal Then
GridView1.Columns(10).Visible = False
End If
End Sub
For more help : pranayamr@gmail.com
|
|
|
|
|
Pranay,
I did take that in to account to be sure I did change to 10 see the result.
Its was the same but just on the 10th column.
I still get the StackOverflowExceptionwasunhandled
As if its looping but I don't understand why.
Thanks,
|
|
|
|
|
|
Dinesh,
I did find this however I am not too familiar with c#
If you could help translate this toe VB.net that would be fantastic.
Thanks,
Tommy
|
|
|
|
|
I've tried to translate the coding from C# to VB.NET. I think this is the equivalent -
Protected Sub GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
If (GridView1.EditIndex < 0) Then
Exit sub
End If
If ((e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate) && (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)) Then
e.Row.Cells(2).Visible = False
e.Row.Cells(3).Visible = False
End If
End Sub
NOTE: I've not worked in VB.NET for sometime so go easy on me if it doesn't work
HTH!!
|
|
|
|
|
Hi,
grafiksinc
U just take the parameter as 10 in the columns of grid view and check the result.
Thanks.
pshimansu@gmail.com
|
|
|
|
|
Hello All,
Well I did try your suggestions howerver nothing worked. I think next time I will manually create the Table and writ ethe code rathe rthan use the Gridview for this tyoe of situation. With that said here is what i did.
1. Convert the column to a template
2. The columns that I want to hide - site the width to 0
3. In the ItemTemplate just remove the text so that the column title is is blank
4. On the ASP: Code set GridLines = None
5. In the edit template Put the text/check box you want to use
Doing the above steps allowed me to hide the columns in "Normal mode" and have them show in edit mode.
Thanks guys for all the help,
Tommy
|
|
|
|
|
hi all i have used an open source cms named "kentico cms".i have integrated
it locally at my system it successfully exexcuted but when i uploaded it online it is giving me following error:
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
how can i upload it online.plz help its urgent...
the process which i have folowed is corect or wrong..
thanks ....
|
|
|
|
|
Your web site probably does not support anonymous logon.
If this is a company website, you should talk to the administrator to see which authentication methods are support, and how to configure them. Also read up on the documentation of your CMS.
If this is hosted website, search the documentation of your hosting provider.
|
|
|
|
|
hoe to print a report by default in landscape mode by using reportwizard?
|
|
|
|
|
Is it possible to convert a Website project type to a Web application project type without starting over from scratch with a new solution? If so, how?
SOLUTION: There is apparently no one-click tool available to perform this conversion. So I just bit the bullet and sat down and created a new solution and built it up from scratch until it was a Web application project equivalent to my original Website project. It took me about four hours with no "gotchas" to solve that I might have run into had I adopted one of the partial solutions that are out there and actually referenced in one of the answers to my question.
I performed the conversion in the following steps, basically moving from the lowest level to the highest level, compiling at each step. This minimized compile errors due to undefined objects, although I couldn't entirely eliminate them because sometimes low level objects referenced high level objects (I know: bad design; but it isn't too egregious, and I had very few of these).
1. Created a new solution of type, Web application project.
2. I ported the .Web project first, which contains my WCF Web service.
3. Then I ported my utility classes in my Silverlight project.
4. I had my pages divided into categories that were more or less in a hierarchy, and I ported the lowest categories in the hierarchy first, and worked my way up. I had very few unresolved symbols doing it this way.
5. Finally, the few compile errors I had got resolved when I ported my MainPage, the last object to port.
Along the way of course I had to add a few references, but compile errors quickly notified me when I had to do this. The new solution now works exactly like the original.
Why did I do this in the first place? I did it because the Website project type requires you to put your .Web project source code up on your Website! This has things like my connection string (with password!) right out there in plain site for anybody to see, as well as proprietary algorithms generating and validating license keys.
Oh, I know: there's a precompilation tool called aspnet_compiler.exe that will compile this code for you and after that you can obfuscate it, but in Googling about it, it looks as if you have to jump through hoops to get it to work for you. There are also better approaches than putting your source code in a folder (App_Code) off the root of your Website, like putting it into a protected subdomain, but I'm really green at all this Web development stuff and I just want to get something out there I can test as quickly as possible. I'll perform these niceties at my leisure once everything is otherwise working.
modified on Wednesday, May 12, 2010 4:58 PM
|
|
|
|
|
|
Thanks for the links. I haven't had time to look at them yet, but they look exactly like what I need. BTW, I'm using VS2010.
|
|
|
|
|
For the record, I took a look at your first two links and they are for instructions if you're running VS2005, and one of them was for running a beta version of it! The menu system completely changed with VS2008, so maybe your third reference will be easier to follow. But even the first two links describe a brute force way of converting, basically starting over from scratch.
Well, I looked at the VS2008 link and it also is a brute force method. There apparently is no auto-conversion software to do this. I'm going to start over from scratch and completely rebuild my application from the ground up.
|
|
|
|
|
i want to make a CMS for a website of mine : how can i make the html formatting on it ?
and some smiles that formate the text in any web site
|
|
|
|
|
|
Yes TinyMCE is excellent. Otherwise CKeditor is quite good too.
|
|
|
|
|
Hi everyone,
I'm currently working on a web project which supports roles. This is the first time I'm working with roles so I took some help (reading a few books and articles) and it's working fine (locally). I uploaded the project to the remote server today. And, even though I don't have the aspnet_CheckSchemaVersion procedure on my local db, it does on remote server and throws this exception. I really don't know why, I made some googling and found out that I'm not the only one. But I couldn't find a solution.
By the way, in web.config, roleManager is set to enabled="false". I'm really lost here and I would really appreciate if anyone could at least give me a clue about why this happens.
Thanks.
|
|
|
|
|
You'll need to run aspnet_regsql to ensure the stored proc has been installed
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi all!
i have a html table with data.i convert the data into the csv format and save in an string strCSV on client side.Now i want user can download this strCSV value as .csv file on client side.
thanks
|
|
|
|
|
zeeShan anSari wrote: want user can download this strCSV value
The data is already downloaded, its on the client-side!
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
yes all data save in string strCSV
|
|
|
|
|
You obviously missed the point. You can't download it because it is already downloaded. Where do you think client-side code and data is stored?
Must AV software and browsers will not allow you to create a file on the clients system without a specific action and permission. Your best bet would be to create a link that when clicked will download this file from the server. Which, since it has to be spelled out for you, means it is unnecessary to create the data on the client.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi All,
I have a gridview with 26 rows and four columns dynamically build. Each row there have two columns with dropdownlist and a textbox. I need to capture all the rows and column that have data selected when user click submit button to send to sql database. Being newbie to asp.net not sure how to accomplish this. Any help is greatly appreciated.
col1 col2 col3 col4
firstname ddl1 ddl2 textbox
lastname ddl1 ddl2 textbox
dob ddl1 ddl2 textbox
addrs ddl1 ddl2 textbox
Thanks,
DocHoliday
|
|
|
|
|