|
daffy_2003 wrote: however, when a new file is uploaded, the existing info in the gridview is being overwrite by the new one. Any idea how to not let it overwrite the previous data?
This is why, I guess you didnt check the IsPostback Property on Page_Load().
So when the Image is uploading, Page is getting postback and grid is binding with blank data.
Do something like this is Page_Load
if( ! Page.ISPostBack)
{
BindGrid();
}
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hey there, it doesn't work. And another problem is that i have to close the page and open again before the gridview update itself. what should i do?
|
|
|
|
|
I want to bind not all but one part of columns of a datasource to a gridview, but I do not know which function can be used?
for example, the following code is used to bind all columns of database "Departments" to gridview departmentsGrid.
departmentsGrid.DataSource = dataSet.Tables["Departments"].DefaultView;
departmentsGrid.DataBind();
Note that for the gridview, I have set "AutoGenerateColumns" as True.
therefore, I have to select all the columns to bind. perhaps, I can set "AutoGenerateColumns" as False and then bind the columns one by one?
or is there any better solution?
thank you!
|
|
|
|
|
You have to do it on RowDataBound Event of Gridview.
|
|
|
|
|
It is always better to specify columns on the designer and AutoGenerateColumns false. So that if the selection to departments changes the page becomes intact.
|
|
|
|
|
I want to bind the gridview to a datasource which contains one image field. I have the following questions:
1: I use SQL 2005, it seems to be there are one 'image' type and one 'varbinary(max)', which one should be used?
2: in order to bind the imagefield to the gridview, i have to add one imagefield in the gridview, because gridview can not automatically to bind it.
but I use the following code, the image can not be displayed, instead of a red cross:
<asp:ImageField HeaderText="image" NullDisplayText="no"
NullImageUrl="~/Images/book_closed.gif" DataImageURLField="ImageTest">
</asp:ImageField>
<asp:sqldatasource id="DepartmentsSource"
selectcommand="Select [DepartmentID], [DepartmentID], [ImageTest],[Tel] From [Departments]"
connectionstring="Server=localhost\SqlExpress;Database=Dorknozzle;Integrated Security=True" providerName="System.Data.SqlClient"
runat="server"/>
anyone can give me one hint why?
thank you!
|
|
|
|
|
|
thanks, oh, right, your save image file just as the string path and it is GOOD.
|
|
|
|
|
Hello All,
I have designed menucontrol which renders dynamically by reading Xml file.
Here i am facing problem while applying differnt styles to menu item for static Menu
Please refer below diagram for Menu control, that i want to design programatically whose MenuItem text can be changed dynamically by changing Xml file.
Here i am not able to apply different style to menu item, I want "At School" & "At College" to be bold and "SclItem1 2 3" & "ClgItem1 2" to be in Normal font with some padding to its left programatically.
If you have any idea please post here or mail me on vikramkulkarni2007@gmail.com
Diagram
Education
--------------
At School -->Needs to be bold
SclItem1 -->Normal font
SclItem2
SclItem3
--------------
At College -->Needs to be bold
ClgItem1 -->Normal font
ClgItem2
--------------
Please do reply
Thanks,
Vikram
|
|
|
|
|
|
Hi there ..
i design manually a gridview with 3 bound column and 3 button collumn
how can i add the values of datatable to bound column in gridview
i used the code
GridView1.Rows(0).Cells(3).Text = dt.Rows(0)("Year").ToString
but its is always give error out of index range
i wrote gridview1.datasource= datatable
gridview1.databind()
but no values appear it just appers when i used autogenerateproperty = true ( No designed GridView )
so my question is how to add value to viewgrid bound coulmn or template column ?
or how to add new row to grid view ?
or how to set the colloumn button at the end of the grid ??
one of these question will help me
thank you very much
|
|
|
|
|
Bannoota wrote: or how to add new row to grid view ?
You want to add records from gridview ?
Have a look into it.
Adding an insert row to GridView[^]
Or you want something different ?
|
|
|
|
|
I'm busy getting to grips with my first Dynamic Data project, using LINQ to Entities. It's going quite well so far, but on my Employees edit form, when I click the 'Update' link, it calls back to the Edit.aspx page, but nothing else happens. No SQL is sent, and no error is raised. I have had this problem before with a SqlDataSource simply swallowing exceptions, but I've been led to believe that the object based DataSource components are better behaved.
I have no idea where to begin looking, because the Edit.aspx has no explicit update code in it, so I have this dark cloud between it and my DB where something is happening to my update, which is anybody's guess.
|
|
|
|
|
why dont you debug the application and see what error is occurring. Have you seen SQL profiler as if there is any entry of update statement being generated and the error is generated in SQL server or not?
|
|
|
|
|
There is nothing to debug. My break point in the Updating event hits, but not the updated event. No SQL is sent through. I've discovered that something, probably EF, doesn't like self-referencing tables, e.g. the Employees table has a one-to-many relationship with itself, because the Supervisor field points back to an EmployeeID.
|
|
|
|
|
I am nw develop a website and in my project,login form can aslo be included and i have designed this through layers and tables.But is any how user dont fill correct username or password an alert will be shown by javascrpt which disturb my interface slightly...
please help me or suggest for this..what can i do for resolving that problem
|
|
|
|
|
Nitinpro wrote: which disturb my interface slightly...
What do you mean you distrub interface ? Any allignment problem or what ?
|
|
|
|
|
yes sir,alignment can be disturbed while alert can be shown...sr please suggest me for this problem ..how it can be resolved??
|
|
|
|
|
Why do you want to show javascript alert ?
If user is not authenticated properly show a nice message in Red color just below the Login box like "Username/Password is incorrect. Please relogin" as every site does.
You may have Forgot Password link as well.
|
|
|
|
|
Hi. I have to hide the particular column in the gridview how can i do that?
|
|
|
|
|
srikantha_nagaraj wrote: Hi. I have to hide the particular column in the gridview how can i do that?
This can be done by following ways,
GridView1.Columns[0].Visible = false;
or Set the Width=0 for that column.
Hope this will help you
|
|
|
|
|
Hi,
I want menus trip at the bottom of the page in .aspx page. So is there any menu strip control available in asp.net. If there is any java script then let me know.
Is there any other solution the let me know.
I want menu strip just like facebook have..i e. Menu strip is stick with window even if we scroll the window.
Thanks
sjs4u
modified on Saturday, August 15, 2009 3:20 AM
|
|
|
|
|
Hi,
For a long time I am searching to create “NotifyIcon” from the ASP.net page in Client Machine. My background idea is; I want to call one web service using timer control; from this Notify Icon in client machine.
I could not find any direct way to create NotifyIcon using ASP.net. Today I got some idea, I am not sure am I in correct track or not..
Can I use .net “Activex Control” to create Notify Icon and putting that control in ASP.net page? Automatically when user opens my webpage it will install NotifyIcon and other functionality from that control to client page.
I am not exactly whether it works or not..! Can you please suggest how can I take this forward..
1.Will I get any security exceptions
2.Does it work on client machines where they do not have installed .net framework
3.Is there any other better approach to do this..
thank you,
-nm
|
|
|
|
|
nmreddy83 wrote: For a long time I am searching to create “NotifyIcon” from the ASP.net page in Client Machine
You are asking about System Try Icon ? or you want to show some kind of notify popup to client browser ? You can look into it.
nmreddy83 wrote: Can I use .net “Activex Control” to create Notify Icon and putting that control in ASP.net page?
ASP.NET Popup Control[^]
ActiveX will only work on IE.
nmreddy83 wrote: My background idea is; I want to call one web service using timer control; from this Notify Icon in client machine.
Use AJAX. and ASP.NET Popup control to notify.
|
|
|
|
|
i am asking for Tray Icon
|
|
|
|