Click here to Skip to main content
15,913,487 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to search users from active directory in different FOREST? Pin
Piyush Vardhan Singh9-Jul-09 1:43
Piyush Vardhan Singh9-Jul-09 1:43 
QuestionDNN WEbsite Pin
Bataineh8-Jul-09 21:33
Bataineh8-Jul-09 21:33 
AnswerRe: DNN WEbsite Pin
swjam8-Jul-09 22:12
swjam8-Jul-09 22:12 
GeneralRe: DNN WEbsite Pin
Bataineh8-Jul-09 22:31
Bataineh8-Jul-09 22:31 
GeneralRe: DNN WEbsite Pin
Abhijit Jana9-Jul-09 1:59
professionalAbhijit Jana9-Jul-09 1:59 
Questionlock/unlock user Pin
vikas shukla8-Jul-09 21:06
vikas shukla8-Jul-09 21:06 
AnswerRe: lock/unlock user Pin
Abhijit Jana8-Jul-09 21:12
professionalAbhijit Jana8-Jul-09 21:12 
Questionfckeditor forbid to write Pin
kof_fans8-Jul-09 20:57
kof_fans8-Jul-09 20:57 
AnswerRe: fckeditor forbid to write Pin
kof_fans9-Jul-09 15:50
kof_fans9-Jul-09 15:50 
QuestionError Pin
KhandelwalA8-Jul-09 20:31
KhandelwalA8-Jul-09 20:31 
AnswerRe: Error Pin
Abhijit Jana8-Jul-09 20:44
professionalAbhijit Jana8-Jul-09 20:44 
AnswerRe: Error Pin
himanshu25618-Jul-09 22:15
himanshu25618-Jul-09 22:15 
GeneralRe: Error Pin
KhandelwalA8-Jul-09 23:03
KhandelwalA8-Jul-09 23:03 
GeneralRe: Error Pin
himanshu25619-Jul-09 1:12
himanshu25619-Jul-09 1:12 
Questionupdate a numeric datatype value in a gridview Pin
haleemasher8-Jul-09 20:21
haleemasher8-Jul-09 20:21 
Questionlinkbutton in gridview Pin
vikas shukla8-Jul-09 20:20
vikas shukla8-Jul-09 20:20 
AnswerRe: linkbutton in gridview Pin
Abhijit Jana8-Jul-09 20:49
professionalAbhijit Jana8-Jul-09 20:49 
Questiongadget concept how to do plz give me some idea Pin
Member 38798818-Jul-09 20:15
Member 38798818-Jul-09 20:15 
Questionplz tell me,how to compare zero value with image control url Pin
nari08208-Jul-09 20:13
nari08208-Jul-09 20:13 
AnswerRe: plz tell me,how to compare zero value with image control url Pin
Abhijit Jana8-Jul-09 20:19
professionalAbhijit Jana8-Jul-09 20:19 
QuestionPlease help with Data Grid export problem Pin
Hammad Mansoor8-Jul-09 20:03
Hammad Mansoor8-Jul-09 20:03 
AnswerRe: Please help with Data Grid export problem Pin
Abhijit Jana8-Jul-09 20:51
professionalAbhijit Jana8-Jul-09 20:51 
GeneralRe: Please help with Data Grid export problem Pin
Hammad Mansoor8-Jul-09 21:06
Hammad Mansoor8-Jul-09 21:06 
AnswerRe: Please help with Data Grid export problem [modified] Pin
kumar_k5088-Jul-09 22:22
kumar_k5088-Jul-09 22:22 
Hi,

CHeck the below code...

  Response.Clear()<br />
        Response.Charset = ""<br />
        'set the response mime type for excel<br />
        Response.ContentType = "application/vnd.ms-excel"<br />
        Response.Charset = "iso-8859-1"<br />
        'create a string writer<br />
        Dim stringWrite As New System.IO.StringWriter<br />
        'create an htmltextwriter which uses the stringwriter<br />
        Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)<br />
        dg.DataSource = ds<br />
        'bind the datagrid<br />
        dg.DataBind()<br />
        'tell the datagrid to render itself to our htmltextwriter<br />
        dg.RenderControl(htmlWrite)<br />
        Dim strStyle As String = "<style>.text { mso-number-format:\@; } </style>"<br />
        Response.Write(strStyle + stringWrite.ToString)<br />
        Response.AddHeader("Content-Disposition", "attachment")<br />
        Response.End()<br />
<br />
<br />
<br />
<br />
 Protected Sub dg_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles dg.RowDataBound<br />
        If e.Row.RowType = DataControlRowType.DataRow Then<br />
            e.Row.Cells(1).Attributes.Add("class", "text")<br />
        End If<br />
    End Sub<br />


and just change the code in response.write line according to above...

CheersRose | [Rose]

S Kumar

modified on Thursday, July 9, 2009 4:35 AM

GeneralRe: Please help with Data Grid export problem Pin
Hammad Mansoor9-Jul-09 18:46
Hammad Mansoor9-Jul-09 18:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.