简体   繁体   中英

File Size column with kb in sharepoint

I am using spgridview to display the items in a library based on library viewid. I am assigning the datasource as SPlist.items.getdatatable();. Here for file size column, I am getting the values in number. But i need to show in KB's.

How can i show the filesize values with kb,mb as suffix without looping each column in the datatable?

Thanks in Advance

Can you try this.... ?

<asp:TemplateField HeaderText="HeaderText">
    <ItemTemplate>
     <asp:Label ID="lbl" runat="server" <%# Convert.ToString(Eval("ColumnName")/1024) + " KB" %> ></asp:Label>
    </ItemTemplate>
 </asp:TemplateField>

As i know,

We can't do. The alternate is to do looping and apply validation for each row data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM